- [x] Staging hunks
- [x] Unstaging hunks
- [x] Write a randomized test
- [x] Get test passing
- [x] Fix existing bug in diff_base_byte_range computation
- [x] Remote project support
- [ ] ~~Improve performance of
buffer_range_to_unchanged_diff_base_range~~
- [ ] ~~Bug: project diff editor scrolls to top when staging/unstaging
hunk~~ existing issue
- [ ] ~~UI~~ deferred
- [x] Tricky cases
- [x] Correctly handle acting on multiple hunks for a single file
- [x] Remove path from index when unstaging the last staged hunk, if
it's absent from HEAD, or staging the only hunk, if it's deleted in the
working copy
Release Notes:
- Add `ToggleStagedSelectedDiffHunks` action for staging and unstaging
individual diff hunks
Closes#22252
This PR fixes the bug introduced in
https://github.com/zed-industries/zed/pull/19495 by:
Problem:
The vertical scrollbar is currently rendered absolutely on top of the
editor. When calculating soft wrap, the editor uses its width to decide
how many words fit on a line. This causes words to overlap with the
vertical scrollbar because it doesn't account for the scrollbar's width.
To fix the overlap, extra overflow is added to the scrollbar, which
solves the issue but creates unnecessary scrolling in soft wrap mode.
Fix:
The editor width is adjusted to account for the scrollbar's width. This
makes sure the correct number of words fit on a line and prevents
overlapping with the scrollbar in soft wrap mode.
Since the scrollbar width is now accounted for in the editor's width,
there's no need to add extra overflow, unless there’s no soft wrap. In
that case, when text overflows the editor’s width, we still need to add
extra overscroll to match the scrollbar width. Without this, long lines
will overlap with the scrollbar.
Release Notes:
- Fixed issue where horizontal scrollbar would scroll few characters
width when soft wrap is active.
This makes the tab tab tab experience smoother
Release Notes:
- N/A
---------
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: as-cii <as-cii@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Ben <ben@zed.dev>
This PR puts the "Eager Preview Mode" menu entry behind a feature flag
rather than a staff flag.
Currently it defaults to `false` for staff so that it doesn't leak into
any marketing/launch materials.
Folks who want to see it can opt-in to the flag explicitly, for now.
Release Notes:
- N/A
closes https://github.com/zed-industries/zed/issues/19620.
I am not 100% sure on how to test this though. @elithrar: would you mind
giving this branch a shot and seeing if it works for you? I kicked off
bundling for this pull request and you should be able to download a DMG
from the CI artifacts as soon as it's done building.
Release Notes:
- Fixed a bug that caused OS-level CA certificate bundles to not be
respected.
---------
Co-authored-by: Bennet <bennet@zed.dev>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
This PR updates the file icon mappings such that:
- C# (`.cs`) files map to the `csharp` key
- Cue (`.cue`) files map to the `cue` key
- GitLab YAML (`gitlab-ci.yml`) files map to the `gitlab` key
- Luau (`.luau`) files map to the `luau` key
- Solidity (`.sol`) files map to the `solidity` key
Release Notes:
- Icon themes: Added the ability to change the file icon for C# (`.cs`)
files.
- Icon themes: Added the ability to change the file icon for Cue
(`.cue`) files.
- Icon themes: Added the ability to change the file icon for GitLab YAML
(`gitlab-ci.yml`) files.
- Icon themes: Added the ability to change the file icon for Luau
(`.luau`) files.
- Icon themes: Added the ability to change the file icon for Solidity
(`.sol`) files.
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Rationale for the changes:
* `requires migration` -> `uses some deprecated settings` changed
because really it isn't required by this version of Zed, and I believe
we hope to offer support for deprecated settings and their migration for
a long time.
* Rename of `migration` -> `updated` is because to me, "updated" feels
lighter and more accurate. To me migration has connotations of moving to
a whole new format.
Formatting changes are due to shortening the line causing cargo fmt to
go from not formatting the code to doing so.
Release Notes:
- N/A
---------
Co-authored-by: smit <0xtimsb@gmail.com>
This PR adds:
- Support for deprecated keymap and settings (In-memory migration)
- Migration prompt only shown in `settings.json` / `keymap.json`.
Release Notes:
- The migration banner will only appear in `settings.json` and
`keymap.json` if you have deprecated settings or keybindings, allowing
you to migrate them to work with the new version on Zed.
Moves tab whitespace insertion logic out of `AcceptEditPrediction`
handler.
`edit_prediction_requires_modifier` context will now be true when on a
line with leading whitespace, so that `alt-tab` is used to accept
predictions in this case. This way leading indentation can be typed when
edit predictions are visible
Release Notes:
- N/A
Co-authored-by: Ben <ben@zed.dev>
Co-authored-by: Joao <joao@zed.dev>
This PR adds support for configuring both a light and dark icon theme in
`settings.json`.
In addition to accepting just an icon theme name, the `icon_theme` field
now also accepts an object in the following form:
```jsonc
{
"icon_theme": {
"mode": "system",
"light": "Zed (Default)",
"dark": "Zed (Default)"
}
}
```
Both `light` and `dark` are required, and indicate which icon theme
should be used when the system is in light mode and dark mode,
respectively.
The `mode` field is optional and indicates which icon theme should be
used:
- `"system"` - Use the icon theme that corresponds to the system's
appearance.
- `"light"` - Use the icon theme indicated by the `light` field.
- `"dark"` - Use the icon theme indicated by the `dark` field.
Closes https://github.com/zed-industries/zed/issues/24695.
Release Notes:
- Added support for configuring both a light and dark icon theme and
switching between them based on system preference.
Don't animate the cursor when previewing jumps.
Instead, display the jump popover with a line that resembles a cursor,
indicating the jump destination. If the jump destination is outside of
the view port, there is an extra step in which `tab` scrolls the
viewport to reveal the jump destination.
Release Notes:
- N/A
---------
Co-authored-by: danilo-leal <daniloleal09@gmail.com>
Co-authored-by: agu-z <hi@aguz.me>
Re-lands https://github.com/zed-industries/zed/pull/24446 with a more
appropriate fix
https://github.com/user-attachments/assets/45f665f0-473a-49bd-b013-b9d1bdb902bd
After activating 2nd diagnostics group, `find_map` code for next
diagnostics did not skip the previous group for the same place.
This time, instead of fiddling with the diagnostics group comparison,
the code splits the diagnostics by search place, looks up the active
group (if any) in both split parts, and selects the entries after the
group elements.
Release Notes:
- Fixed `editor::GoToDiagnostics` action stuck when multiple diagnostics
groups belong to the same place
This PR updates the `GET /user` endpoint to update the user's email and
name from the provided GitHub profile information on sign-in.
Currently, these fields were only set when the user was first created.
Release Notes:
- N/A
This PR does some clean up for the edit predictions settings:
- Removed `editor.show_edit_predictions_in_menu`
- Renamed `edit_predictions.inline_preview` to `edit_predictions.mode`
Release Notes:
- N/A
---------
Co-authored-by: Agus Zubiaga <agus@zed.dev>
This PR adds the ability to change the predict edits URL using the
`ZED_PREDICT_EDITS_URL` environment variable.
This allows for easily pointing Zed to a development version of the
Cloudflare Worker.
Release Notes:
- N/A
Closes#21967
Add actions `CopyFileName` and `CopyFileNameWithoutExtension` to be used in the command palette.
Release Notes:
- Added commands `editor: copy file name` and `editor: copy file name without extensions`.
We've seen a few crashes in `SyntaxSnapshot::reparse_with_ranges` during
`Buffer::preview_edits`, where an offset conversion fails because it is
out of range.
We are not sure how exactly this is happening.
Our theory is that the syntax snapshot is using an outdated state when
edits happen in the meantime (while interpolating). This is an attempt
to see if it helps with the panics, hopefully we can revisit this when
we have a better understanding of the issue.
Co-Authored-by: Antonio <antonio@zed.dev>
Release Notes:
- N/A
Co-authored-by: Antonio <antonio@zed.dev>
This PR updates the asset paths used in more GPUI examples such that
they work when run from the repository root or from within
`crates/gpui`.
Release Notes:
- N/A
This PR updates the file icon mappings such that Markdown (`.md`,
`.markdown`) files map to the `markdown` key.
Release Notes:
- Icon themes: Added the ability to change the file icon for Markdown
(`.md`, `.markdown`) files.
This PR updates the GPUI `image` example such that it works when run in
the following ways:
- `cargo run -p gpui --example image` from the repository root
- `cargo run --example image` from within `crates/gpui`
Release Notes:
- N/A
This PR updates the file icon mappings such that Svelte (`.svelte`)
files map to the `svelte` key.
Release Notes:
- Icon themes: Added the ability to change the file icon for Svelte
(`.svelte`) files.