Using the `Open File` action from a file in commit context takes you to
a read-only snapshot of the file at the point in time of the commit.
This change makes it so you navigate to the current working copy of the
file, if one exists. This has similar semantics to copy file reference.
For a file that still exists at HEAD:
<img width="715" height="469" alt="image"
src="https://github.com/user-attachments/assets/e217e0be-b549-46fa-9d1b-eba92728fa4a"
/>
For a file that no longer exists:
<img width="438" height="271" alt="image"
src="https://github.com/user-attachments/assets/ac87465b-971b-4413-8bf3-71e49a71bdea"
/>
Release Notes:
- Add affordance to jump to project file from commit view
Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes #ISSUE
Release Notes:
- N/A
These changes attempt to expand on the work introduced by
https://github.com/zed-industries/zed/pull/54778 by introducing a new
`GoToDefinitionScrollStrategy::Preserve` variant that attempts to keep
the cursor at the same vertical offset within the viewport when
navigating to a definition.
Most of the machinery for this was already in place. To support cases
where the user's scroll position isn't snapped to an exact display row,
for example, after scrolling with the mmouse, `Autoscroll::TopRelative`
and `Autoscroll::BottomRelative` were updated from `usize` to
`ScrollOffset`, allowing fractional offsets.
When the cursor is offscreen at the moment the `editor: go to
definition` action is invoked, `Preserve` falls back to
`Autoscroll::center`, matching the existing default for
`go_to_definition_scroll_strategy`. This avoids attempting to preserve
an offset where the cursor isn't visible which would lead to the cursor
being offscreen when jumping to the definition.
Documentation has also been updated to reflect this new strategy value.
Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Relates to #52173
Release Notes:
- Added a new `preserve` option to `go_to_definition_scroll_strategy`
that keeps the cursor at the same vertical position within the viewport
when navigating to a definition
This fixes an issue where due to the scrollbar appearing, the reported
content size would shift, causing issues in the process. We now actually
always reserve space for the scrollbar appropriately as described in
https://github.com/zed-industries/zed/pull/33636 initially.
Release Notes:
- Fixed an issue where the scrollbar could cause a layout shift in the
terminal.
---------
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Fixes a bug in the split diff spacer calculation when a patch group
starts mid-row, sometimes causing extra spacers to be inserted.
`spacer_blocks` already explicitly handles the case where `first_point`
isn't at the start of `edit_for_first_point.old`, but the `while let
Some(source_point) = source_points.next()` loop that follows implicitly
assumes that `source_point` is at the start of `current_range`, which in
turn seems to be based on the assumption that `current_range` starts at
the beginning of a row. As it turns out, `current_range` isn't
guaranteed to start at the beginning of a row, which can sometimes lead
to incorrect spacer blocks being inserted.
This addresses that by moving the existing `if
edit_for_first_point.old.start < first_point` logic into the loop body
as `if current_edit.old.start < current_boundary` in order to handle any
non-row-aligned patch groups, not just the first one.
Here's an example of how this bug could manifest:
https://github.com/user-attachments/assets/1d3a5b4c-e4ad-4d87-804b-c4390d25f408
After:
https://github.com/user-attachments/assets/b15acc62-33fe-4154-82e5-5cdf1806ffa7
Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Release Notes:
- Fixed incorrect spacer blocks sometimes appearing in the split diff
view when editing the file.
Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes#54737.
#48752 added empty-prefix `block_comment` entries to several language
configs (Go, C, C++, JSONC, Python, JSX inner) to support the new
toggle-block-comments action.
In `Editor::rewrap_impl`, the comment-format matcher used
`buffer.contains_str_at(indent_end, &config.prefix)` to decide whether
the current line is a continuation of a block comment. When the language
is configured with an empty prefix, this is true on every line. `//`
(and `#`) line comments inside a `comment` override scope were
classified as `BlockLine("")` and never reached the line-comment
fallback. The result was that the line-comment prefix was not stripped
before wrapping and not re-prepended after, embedding `//` markers as
text in the wrapped paragraph.
Skip the BlockLine arm when the configured prefix is empty so the
matcher falls through to `line_comment_prefixes`.
I've included regression tests for both golang (which adds a new
treesitter dep to the editor package) and C/C++.
Release Notes:
- Fixed line comment rewrapping in golang and C/C++
Found this bug while investigating why configuring nextest based on the
instructions at
https://github.com/rust-lang/rust-analyzer/issues/21137#issuecomment-4254611341
wasn't working within Zed.
Previously, we'd use `serde(untagged)`, preferring cargo over shell
commands. The problem is that every instance of a shell command is a
valid instance of a cargo command. For example, the shell command:
```json
{
"label": "test my_test",
"kind": "shell",
"args": {
"environment": {"RUSTC_TOOLCHAIN": "/path/to/toolchain"},
"cwd": "/project",
"program": "cargo",
"args": ["nextest", "run", "--package", "my-crate", "--lib", "--", "my_test", "--exact", "--include-ignored"]
}
}
```
would end up getting deserialized as a Cargo command, silently dropping
`program` and `args`.
With this fix, we now use the provided `kind` as a tag. We do have to
introduce a `#[serde(flatten)]` unfortunately, which has a few side
effects due to internal buffering, but `#[serde(untagged)]` also does
internal buffering so this doesn't make things worse.
I've manually tested this by configuring:
```json
{
"lsp": {
"rust-analyzer": {
"initialization_options": {
"runnables": {
"test": {
"overrideCommand": [
"cargo",
"nextest",
"run",
"--package",
"${package}",
"${target_arg}",
"${target}",
"--",
"${test_name}",
"${exact}",
"${include_ignored}"
]
}
}
}
}
}
}
```
and ensuring that nextest is correctly invoked.
Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Release Notes:
- Fixed deserialization of rust-analyzer shell runnables.
---------
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Expand all excerpts had a doc comment describing it as expanding all
excerpts, but in practice it only expanded the excerpt that was the most
relevant.
I fixed that to make it expand all excerpts.
video:
https://github.com/user-attachments/assets/9858ebda-199c-4f72-8a2f-3cd606b0eff4
Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes#54651
Release Notes:
- editor: `expand excerpts` now has correct documentation explaining its
function.
Follow-up to https://github.com/zed-industries/zed/pull/54100
Instead of relying on "line number" that could have overlapped depending
on the range we query, use hierarchical IDset: `block id -> lens #` to
ensure no clashes happen anymore.
Release Notes:
- N/A
Allows to reconfigure behavior, including the previous one, `top`
Closes https://github.com/zed-industries/zed/issues/52173
Release Notes:
- Reworked go to definition to open its target in the center of the
editor. Can be reconfigured with `go_to_definition_scroll_strategy`.
Hides and disables all mutating editor actions for readonly editors.
Certain actions (as cmd-backspace mentioned in the issue) could be
somewhat beneficial to have for navigation purposes, but we'd better
shape that story properly, let's build a "harness" and disable the
mutating ones first.
Closes https://github.com/zed-industries/zed/issues/47333
Release Notes:
- Fixed readonly editor having certain mutation actions enabled
The highlight queries only matched JSX member-expression tags when the
object was a plain identifier (`<A.B>`), so tags with more than one dot
like `<A.B.C>` lost their component-tag highlighting.
The fix explicitly captures every leaf `identifier` and
`property_identifier` at each nesting depth (up to 3 levels) in the
JavaScript and TSX highlight queries so each token gets its own
`@tag.component.jsx` capture that beats the generic `@property` rule.
A more concise approach, capturing the whole nested
`(member_expression)` node as a single `@tag.component.jsx` blob, does
not work because the generic `(property_identifier) @property` rule
targets a smaller, more specific node inside the blob, winning the
resolution for inner segments like `B` in `<A.B.C>`.
Closes#53305
Release Notes:
- Fixed highlighting for nested JSX member expression tags in JavaScript
and TSX files.
---------
Co-authored-by: dino <dinojoaocosta@gmail.com>
Painting primitives at non-integer pixel coordinates produces blurry
output. Pixel snapping converts layout coordinates into integer
device-pixel coordinates so painted edges land exactly on physical pixel
boundaries.
Non-integer coordinates can arise for several reasons, including:
- flex distribution, percentages, centering, and text measurement can
produce fractional element sizes and positions;
- at fractional scale factors (for example 125% or 150%), integer
logical-pixel values can map to non-integer device-pixel values.
We pixel-snap by rounding in device-pixel space, after multiplying by
`scale_factor`, so that snapping targets physical pixels. Bounds are
divided by `scale_factor` before being returned to GPUI.
Midpoints are rounded toward zero. This is a stylistic choice: a
1-logical-pixel line at 150% scale should render as 1 dp rather than 2
dp.
Pixel snapping is done in two phases:
1. Pre-layout metric snapping. Before Taffy computes layout, all
authored absolute lengths are rounded in `to_taffy`. This includes
borders, padding, gaps, and explicit sizes. Custom-measured leaf nodes
have their measured sizes rounded up to integer device-pixel lengths.
2. Post-layout edge snapping. After Taffy resolves the tree, layout
relationships such as flex shares, grid tracks, percentages, and
centering can produce new fractional edge positions. Boxes now have
edges in absolute coordinates, and snapping must decide where those
edges land on the device-pixel grid.
Ideally, post-layout snapping would satisfy:
- Edge closure. Two raw layout edges at the same absolute position
should snap to the same pixel column.
- Translation stability. A component's internal geometry should not
change when it moves to a new absolute position.
These goals are in tension because rounding is not associative. The
simple local schemes make different tradeoffs:
- Absolute edge rounding gives each window coordinate one answer, so
coincident edges always close globally. But a span's snapped length is
`round(far) - round(near)`, which may change by 1 dp as its absolute
origin moves.
- Parent-relative edge rounding rounds each child inside its parent's
coordinate space. This guarantees translation stability, but a shared
edge reached through different parents can accumulate different
rounding, causing non-closure between cousins.
- Length rounding rounds each width, height, and thickness independently
and then places boxes from those rounded lengths. Sizes stay stable
under translation, but neighboring boxes derive their shared boundary
from different sources, so closure is not guaranteed.
We apply absolute edge rounding for each element's outer box in
post-layout rounding to preserve closure. Border and padding widths are
not touched by post-layout rounding; they keep their pre-layout rounded
value so that they remain stable under translation.
This gives both closure and translation stability in the case that all
local metrics are integer device-pixel lengths. Pre-layout rounding
covers that in most cases. The exception is metrics resolved by layout
relationships, such as percentages. Outer box edges will still close
globally, and painted border widths are still snapped independently, but
the raw content-box origin can carry a 1 dp residual into descendants.
---
Fixes https://github.com/zed-industries/zed/issues/46360
Fixes https://github.com/zed-industries/zed/issues/44528
Fixes https://github.com/zed-industries/zed/issues/40282
Fixes https://github.com/zed-industries/zed/issues/42257
---
Release Notes:
- Fixed potentially blurry appearance of UI elements when using
fractional display scaling.
Closes#41580
This implements Helix's jump list, Zed already supports jumplists, so
all that is done is re-binding ctrl-s to to that instead. In another PR
we can extend this by adding space+j functionility to see all selections
in jumplist.
after this change:
Pressing Ctrl+S saves the current cursor position to the jumplist,
allowing the user to navigate back to this position using Ctrl+O
(backward) and Ctrl+I (forward), consistent with regular Helix's
behavior.
Release Notes:
- N/A *or* Added/Fixed/Improved ...
---------
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
No, sadly, the title is not a typo. See
https://www.githubstatus.com/incidents/zsg1lk7w13cf for the context.
I'll read with joy and popcorn through that root cause analysis.
It makes literally zero sense what happened here, but for some completly
bonkers reason GitHub completely messed up the merge queue with
https://github.com/zed-industries/zed/pull/54632.
I have no idea how it happened. It makes literally zero sense. A PR
going into the merge queue should have the same LoC when getting out of
it. GitHub obviously does not check this. GitHub causes extra work with
a feature that is supposed to save time.
Thanks, I guess.
Release Notes:
- N/A
---------
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
- #54632 unintentionally reverted changes introduced in #54681, likely
due to a merge conflict resolution issue.
See the original PR for the changes.
Release Notes:
- N/A
Co-authored-by: Danilo Leal <danilo@zed.dev>
This PR brings back the button to filter remote branches when accessing
the title bar's branch picker with the mouse. It was unintentionally
removed when we introduced the new worktree picker.
Release Notes:
- N/A
- Don't render the tooltip while the menu is open to avoid collision
- Try to maintain the trigger element visible while the menu is open
- Tweak bookmarks icon and tooltip description copy
Release Notes:
- N/A
---------
Co-authored-by: Yara 🏳️⚧️ <git@yara.blue>
Co-authored-by: Joseph T. Lyons <JosephTLyons@gmail.com>
Reconciles `Open File` behaviour to the same action as using the
keybinds.
Closes#54502
Release Notes:
- Fixed a bug where the `Open File` button would not jump to the excerpt
containing the active cursor.
To hide the gutter_context_menu in collab notes (where it would be empty
anyway) we checked for the collaboration_hub. But that is unrelated to
collab notes it turns out :)
So now we check for the presence of a project which is always false for
collab notes.
Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes#54559
Release Notes:
- N/A Fixed context menu in the editor gutter not showing when there was
a break-point set but breakpoints are not shown in the buffer.
Search is highly generic, editor is the only implementation that has a
concept of a cursor. When the cursor moves eventually
`Editor::selections_did_change` runs which among a bunch of things
triggers the `SearchEvent::ActiveMatchChanged`. This was handled by the
`BufferSearchBar` by moving the currently highlighted item.
When going to the next search result (from the cursor position) we call
`BufferSearchBar::match_index_for_direction`. It relied on the
current_index being updated during the handling of `ActiveMatchChanged`
which we removed. It now instead figures out the next/prev search result
from the users cursor in the buffer directly.
The `SearchEvent::ActiveMatchChanged` was being used for different
responsibilities in different places in the codebase where it was
emmited, namely:
* On the `editor::Editor::selections_did_change` it was being emmited in
case a single selection (single cursor) existed, and this was the
thing reponsible for indirectly updating the active match as soon as
the cursor moved out of match.
* On the `terminal` side, it's being emitted when the user clicks on the
terminal, to "simulate" what the cursor position would be and update
the active match to the next closes match compared to the click
position.
* On the `markdown_preview` side it was being emmited whenever the
active match was updated but, from testing, it does actually seem to
not drive anything and is unnecessary?
Given that we no longer want to update the active match in the buffer
everytime the user moves the cursor, we removed the event emission from
`editor::Editor::selections_did_change` as well as removing the one from
`markdown_preview`, as it seems it doesn't have any noticeable impact.
Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes#44367
Release Notes:
- Fixed search highlighting changing anytime the cursor moves.
---------
Co-authored-by: Yara <git@yara.blue>
Fixes#49466
It looks like this wasn't actually a bug in the PHP outline query, but a
general sticky scroll bug. In PHP, the attribute ends up inside the
`function_declaration` as a child node, so sticky headers were
previously taking their start from `item.range.start` and getting stuck
on the `#[Deprecated]` line instead of `function foo()`. Switching to
`source_range_for_text.start` fixes exactly that, and also covers other
languages that put decorators or attributes before the declaration. I
added the test in TypeScript because it has the same tree shape and
covers the same class of bug as #49466
---
Before:
<img width="967" height="772" alt="Screenshot from 2026-04-07 08-46-10"
src="https://github.com/user-attachments/assets/a6b2aa2b-03f7-4abf-a4c4-c87d41df83ae"
/>
After:
<img width="1245" height="993" alt="Screenshot from 2026-04-07 08-23-32"
src="https://github.com/user-attachments/assets/27ef2487-d7fd-4a73-93e5-97fc719f9245"
/>
<img width="1245" height="993" alt="Screenshot from 2026-04-07 08-23-40"
src="https://github.com/user-attachments/assets/1b1daf80-544d-4128-bc92-b7d44b8d6564"
/>
<img width="963" height="636" alt="Screenshot from 2026-04-07 08-23-53"
src="https://github.com/user-attachments/assets/bb244ce9-797e-4a5f-b48f-eb0e4b982f7d"
/>
---
Tests:
Nextest run ID f0de6791-1a3c-406b-9589-54df870b832b with nextest
profile: default
Starting 3 tests across 1 binary (655 tests skipped)
PASS [ 0.986s] (1/3) editor editor_tests::test_sticky_scroll
PASS [ 0.436s] (2/3) editor
editor_tests::test_sticky_scroll_with_decoration_prefix_in_item
PASS [ 0.822s] (3/3) editor
editor_tests::test_sticky_scroll_with_expanded_deleted_diff_hunks
────────────
Summary [ 2.298s] 3 tests run: 3 passed, 655 skipped
Release Notes:
- Fixed sticky scroll headers showing attribute/decorator lines instead
of the declaration line in PHP and other languages where annotations are
child nodes of the declaration.
Co-authored-by: dino <dinojoaocosta@gmail.com>
## Summary
- Enable VSCode-like side-by-side file comparison in FileDiffView using
SplittableEditor
- Leverages existing SplittableEditor infrastructure that ProjectDiff
already uses
- Controlled by the user's `diff_view_style` setting (split/unified)
## Changes
- `crates/git_ui/src/file_diff_view.rs`: Refactored to use
SplittableEditor instead of plain Editor (+66/-30 lines)
## Test plan
- [ ] Open a file with git changes and verify the diff view renders
correctly
- [ ] Toggle between split and unified diff view styles via settings
- [ ] Verify side-by-side comparison shows old/new content correctly
Release Notes:
- Enabled side by side diffs in the file diff view
Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
Basically just applied the suggested fix as described in #53606 , I also
experimented with a hackier soln. that used the same logic as the code
this is replacing, but it seemed solidly worse than this version.
The original issue extremely clear with what is going on / what needed
to be fixed.
heres a video:
https://github.com/user-attachments/assets/e7fc60f7-0a8c-403c-877f-93f58f370b00
Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes#53606
Release Notes:
- editor: Fixed incorrect inclusion of comments into folds
Previously, passing an empty range to `range_to_buffer_range` would
return no ranges, which would trigger a fallback case in the git diff
that caused the entire multibuffer to be invalidated every frame.
This PR fixes `range_to_buffer_range`, so that it returns a sensible
range if the input range is empty, preventing the fallback behaviour and
edit expansion.
Self-Review Checklist:
- [ ] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable
Closes #ISSUE
Release Notes:
- N/A or Added/Fixed/Improved ...
---------
Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Fixes an autoscroll bug that sometimes obscures the current row behind a
sticky header.
The bug was caused by `Editor::autoscroll_vertically` using the
`sticky_header_line_count` value that was cached during the previous
render, which isn't necessarily the number of sticky headers that the
scroll target needs, e.g.
- when jumping to a definition
- when pressing the up arrow key when the selection is in the topmost
visible row with `"vertical_scroll_margin": 0`
This fixes that by not caching `sticky_header_line_count` and instead
querying Tree-sitter on the fly to get the number of sticky headers that
the scroll target needs. Performance-wise this seem okay, I measured it
to take less than 200µs on my machine using a very large Rust file (and
there are still some possible ways to optimize this if necessary). In
particular, the pathological huge single-line file case as discussed in
#48450 shouldn't be an issue here because unlike the main sticky header
Tree-sitter query, here we query the outline items that contain a
particular point rather than those that intersect an entire row.
The `ScrollCursorTop` handler is also simplified to use the same shared
function for counting the number of sticky headers, since that action
doesn't rely on autoscroll.
Before:
https://github.com/user-attachments/assets/efb12776-82d9-4b94-baa5-347ec769fb98
After:
https://github.com/user-attachments/assets/236deb9f-fe06-43bd-b167-7bd3ab719e4c
Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes#50803
Release Notes:
- Fixed sticky headers sometimes obscuring the current row.
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
## Summary
Fix completion ordering when two items are otherwise tied and only
differ by letter case.
In cases like `abc` vs `ABC`, if the user types `a`, Zed should prefer
`abc`. If the user types `A`, Zed should prefer `ABC`. This matches the
expectation described in #37081 and #27993, where `subscription` should
rank above `Subscription` for query `s`.
## What changed
In `CompletionsMenu::sort_string_matches`, I added a tie-breaker that
prefers completions with more exact case-sensitive matches at the
fuzzy-match positions.
This only applies after the existing higher-priority sort keys, so it
does not replace fuzzy score, match positions, snippet ordering, or LSP
`sortText`. It only resolves ambiguous ties more intuitively.
## Tests
Added regression coverage in `code_completion_tests` for abstract
case-only examples:
- `a` prefers `abc` over `ABC`
- `A` prefers `ABC` over `abc`
- `ab` prefers `abc` over `ABC`
- `AB` prefers `ABC` over `abc`
- mixed-case multi-letter queries like `Ab` and `aB`
## Verification
Ran:
```bash
cargo test -p editor code_completion_tests
```
PS: all code and description is generated by Codex
Release Notes:
- Fixed completions not tie braking by case
Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Release Notes:
- Fixed a panic when using the split diff view.
Update how auto indentation is handled by `Editor::newline`, in the case
where auto-indentation is not `AutoIndentationMode::None`, so as to
extend the range of the edits being applied to the beginning of the
line, in case the line only contains the indentation whitespace or
there's only whitespace indentation before the cursor position
This ensures that newlines are not left with whitespace.
Closes#34316
Release Notes:
- Fixed auto indent leaving trailing whitespace on blank indented lines
when creating new lines.
---------
Co-authored-by: dino <dinojoaocosta@gmail.com>
Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes#52559
Release Notes:
- Fixed an issue where holding the modifiers used in
`editor::AcceptEditPrediction` would cause the code action menu to
dissapear
Update all direct calls to `Editor::inline_blame_popover::take` to now
be calls to `Editor::hide_blame_popover` as this ensures that the
popover is also not shown in case its task still hasn't finished.
This fixes a bug where the inline git blame popover could be shown even
after the user had opened a modal.
Release Notes:
- Fixed the inline Git blame popover sometimes appearing after opening a
modal.
---------
Co-authored-by: dino <dinojoaocosta@gmail.com>
Super small update changing two instances where
`DiagnosticSeverity::HINT` was set to use the color for "info".
Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes#45637
Release Notes:
- Fixed various instances of hint level diagnostics using the color
designated for info
Hover popovers aren't immediately dismissed when the hover ends, but
this delay mechanism is currently causing popovers to sometimes still
briefly appear when the hover lasted too short to have triggered it.
Fixed by immediately cancelling the popover task when the hover ends
before the popover is displayed.
Most easily reproduced when setting the hover popover delay to a value
lower than the default 300ms (but it still happens sometimes with the
default value), because the popover hide delay is also 300ms. Here's it
with `"hover_popover_delay": 200`:
https://github.com/user-attachments/assets/6415d112-d8e0-4a87-9a79-a7ab559f20f2
After the fix:
https://github.com/user-attachments/assets/34782389-de4c-4a25-bd6e-4858b55028de
Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Release Notes:
- Fixed hover popovers sometimes briefly appearing after the hover
already ended.
---------
Co-authored-by: Lukas Wirth <lukas@zed.dev>