Commit graph

1108 commits

Author SHA1 Message Date
Cameron Mcloughlin
c842fb55dd
sidebar: Keyboard nav improvements (and vim mode) (#51856) 2026-03-18 17:53:04 +00:00
Xiaobo Liu
3af7b644a6
vim: Fix visual block Shift-I jumping to original cursor after Ctrl-D scroll (#50822)
Ensure that the `vim::visual::Vim::visual_block_motion` method is called
when `scroll_editor` is called while in Visual Block mode. This fixes an
issue where, after getting into `Visual Block` mode, if the user used
`ctrl-d` or `ctrl-u` to scroll half of the page, the wrong selection
would be made and, if `shift-i` was used to start inserting at the start
of the line, a single cursor would be placed at the cursor position
where the selection was started, instead of one cursor per each of the
selected lines.

These changes ensure that we now match Neovim's behavior for the same
flow.

---------

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-03-18 10:59:46 +00:00
Max Malkin
1f442da1d3
vim: Fix Helix mode subword motions to select traversed text (#45760)
Update Helix's handling of the following actions in order to ensure that
selections are created when using subword motions:

* `vim::NextSubwordStart`
* `vim::NextSubwordEnd`
* `vim::PreviousSubwordStart`
* `vim::PreviousSubwordEnd`

The handling of these motions was done by
`vim::helix::Vim::helix_move_and_collapse`, which simply moved the
cursor without doing any selection. This commit updates it to correctly
use both `vim::helix::Vim::helix_find_range_forward` and
`vim::helix::Vim::helix_find_range_backward`.

The added tests have been confirmed against Helix's behavior of the following commands:

* `move_next_sub_word_start`
* `move_prev_sub_word_start`
* `move_next_sub_word_end`
* `move_prev_sub_word_end`

Closes #41767

Release Notes:

- Fix subword motions in Helix mode to select traversed text

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-03-17 10:49:01 +00:00
Lukas Wirth
357ee0fa3f
vim: Fix helix select next match panic when search wraps around (#51642)
Fixes ZED-4YP

Sort and deduplicate anchor ranges in do_helix_select before passing
them to select_anchor_ranges. When the search wraps past the end of the
document back to the beginning, the new selection is at a lower offset
than the accumulated prior selections, producing unsorted anchors that
crash the rope cursor with 'cannot summarize backward'.


Release Notes:

- Fixed a panic in helix mode with search selecting wrapping around the
document end
2026-03-16 11:14:26 +01:00
Finn Eitreim
923b5122af
vim: Fix dot repeat ignoring recorded register (#50753)
When a command used an explicit register (e.g. `"_dd` or `"add`), the
subsequent dot repeat (`.`) was ignoring that register and using the
default instead.

Store the register at recording start in `recording_register_for_dot`,
persist it to `recorded_register_for_dot` when recording stops, and
restore it in `Vim::repeat` when no explicit register is supplied for
`.`. An explicit register on `.` (e.g. `"b.`) still takes precedence.

This commit also updates the dot-repeat logic to closely follow Neovim's
when using numbered registers, where each dot repeat increments the
register. For example, after using `"1p`, using `.` will repeat the
command using `"2p`, `"3p`, etc.

Closes #49867

Release Notes:

- Fixed vim's repeat . to preserve the register the recorded command
  used
- Updated vim's repeat . to increment the recorded register when using
  numbered registers

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-03-16 10:05:14 +00:00
Skanda Bhat
ac16a7891f
vim: Fix visual mode entry at line end near trailing newline (#50709)
In Helix, selecting a line with `x` creates a selection from column 0 of
the current row to column 0 of the next row. The default
`InsertEndOfLine` uses the selection head (which is on the next row) to
find the line end, placing the cursor on the wrong line. 

This commit introduces a new `HelixInsertEndOfLine`, mapped by default
to `shift-a` when Helix mode is enabled, that moves left from the head
first to land on the correct line.

Release Notes:

- Fixed `shift-a` in Helix select mode placing the cursor on the wrong
line after selecting with `x`

---------

Co-authored-by: SkandaBhat <9384046+SkandaBhat@users.noreply.github.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-03-12 19:05:28 +00:00
Josh Robson Chase
81da953acf
helix: Always offset cursor on selection (#46311)
https://github.com/zed-industries/zed/pull/42837 added the
`cursor_offset_on_selection` field, which displays the cursor *after*
the end of the selection unless a vim visual mode is enabled, in which
case it gets displayed *at* the end of the selection.

However, the real helix is effectively *always* in select mode, and will
always display the cursor at the end of the selection, whether that
selection is made via its visual mode, a movement key, or with the
mouse.

This makes it so that the helix mode setting is taken into account
regardless of the visual-ness of the vim mode in the `sync_vim_settings`
method.

I also considered simply moving `Mode::HelixNormal` up to the `true` arm
of the match in the `is_visual` method since helix is kinda *always* in
visual mode, but I figured that could have some unintended consequences
and chose to err on the side of caution.

Possibly related to #20121

Closes #46998

Release Notes:

- Fixed the cursor offset in non-visual helix selections

Co-authored-by: Nils Koch <mail@nilskch.dev>
2026-03-12 09:07:58 +00:00
Lukas Wirth
b21f4a3deb
Prevent remote edits from triggering edit predictions when collaborating (#51196)
BufferEvent::Edited had no way to distinguish local edits from remote
(collaboration) edits. This caused edit prediction behavior to fire on
the guest's editor when the host made document changes.

Release Notes:

- Fixed edit predictions triggering on collaboration guests when the
host edits the document.

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
2026-03-10 15:23:49 +00:00
John Tur
4031db17df
Disable the IME on Windows when text input is unexpected (#51041)
Fixes #42444

- Changed `accepts_text_input` on the editor to be more precise.
Previously, it returned `true` only in insert mode. Now it also returns
`true` when an operator is pending.
- On Windows, we disable the IME whenever there is no input handler
which `accepts_text_input`.
- How this improves Vim mode: in insert mode, the IME is enabled; in
normal mode, it is disabled (command keys are not intercepted); when an
operator is pending, the IME is re-enabled.

Release Notes:

- On Windows, the IME is disabled in Vim normal and visual modes.
2026-03-08 04:54:05 +00:00
Conrad Irwin
9ca4c60837
Fix panic in vim increment (#50311)
Fixes ZED-59V

Release Notes:

- vim: Fixed panic when incrementing a number preceded by a multibyte
character
2026-02-27 13:24:37 -07:00
Kasper Nyhus
bf6a737e59
vim: Add configurable yank highlight background color (#49517)
* Add a dedicated `vim.yank.background` theme color for the yank
  highlight, which was previously hardcoded to
  `editor.document_highlight.read_background`.
* When a theme doesn't define `vim.yank.background`, it falls back to
  `editor.document_highlight.read_background` for backwards
  compatibility.
* The VS Code theme importer maps `editor.rangeHighlightBackground` to
  this new color.

Release Notes:

- Added configurable `vim.yank.background` theme color for vim yank
  background highlight

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-02-26 12:01:57 +00:00
Lukas Wirth
0823cacb7a
multi_buffer: Fix outdated anchors resolving incorrectly in diff hunks in resolve_summary_for_anchor (#49719)
Closes https://github.com/zed-industries/zed/issues/48441

Release Notes:

- Fixed panics with selection handling in expanded diff hunk
2026-02-20 16:49:35 +01:00
Lukas Wirth
aa91fd4a96
Reduce amount of closure monomorphizations part 2 (#49688)
Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-02-20 08:32:45 +00:00
Patrik Levák
bad3df6e53
vim: Apply linked edits for delete/change/substitute (#48458)
Ensure that editing one tag in a linked pair correctly mirrors the change 
to the other tag for Vim delete/change/substitute commands, visual 
mode operations, and the standard editor delete action.

Extract a `LinkedEdits` struct to deduplicate linked edit collection and
application across `handle_input`, `replace_selections`, `do_completion`,
`backspace`, and `delete`. Introduce `linked_edits_for_selections` as a
shared helper for building linked edits from the current selections.

Closes #35941

Release Notes:
- Fixed linked edits for delete/change/substitute commands so tag pairs
stay in sync.

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-02-19 12:54:41 +00:00
Eric Holk
9b076586f1
Fix crash: vim paste panics on editor-copied entire-line selections (#49134)
When clipboard data was produced by the editor's copy/cut with multiple
entire-line selections, vim's paste would panic with `byte index N is
out of bounds`.

The editor's `do_copy` and `cut_common` skip the `\n` separator between
clipboard selections when the previous selection was an entire-line
selection (because the text already ends with `\n`). However, vim's
paste code unconditionally did `start_offset = end_offset + 1`, always
assuming a `\n` separator exists between every pair of selections. This
caused the accumulated offset to exceed the text length, resulting in a
string slicing panic.

The fix checks `clipboard_selection.is_entire_line` to decide whether to
skip the separator, matching the behavior of the editor's own `do_paste`
method. The same fix is applied to both the vim and helix paste
implementations.

Release Notes:

- Fixed a crash when using vim paste on clipboard data copied with the
editor's copy command containing multiple entire-line selections.
2026-02-18 15:55:38 -08:00
Lukas Wirth
7d80412cca
Reduce amount of monomorphizations from FnMut closures (#49453)
Replaces a bunch of `impl FnMut` parameters with `&mut dyn FnMut` for
functions where this is the sole generic parameter.
Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-02-18 12:00:02 +01:00
Lukas Wirth
0b3a23c357
sum_tree: Implement Iterator::last and lower bound of Iterator::size_hint (#49448)
Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-02-18 09:52:52 +00:00
lex00
f8f489271e
vim: Apply strict paragraph motion only in vim mode (#48024)
Reverts the editor's paragraph navigation behavior that was changed in
#47734. Whitespace-only lines are now treated as paragraph boundaries
again for non-vim mode users.

Vim mode retains its own implementation where only truly empty lines
are paragraph boundaries.

Release Notes:

- Fixed editor paragraph navigation to treat whitespace-only lines as
paragraph boundaries again

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-02-17 11:40:50 +00:00
Dino
c9fc5feb0e
vim: Make :bdelete use new workspace::CloseItemInAllPanes command (#48988)
Add workspace::CloseItemInAllPanes action that closes the active
item's buffer in every pane where it's open, matching Vim's `:bdelete`
semantics. Pane layout is preserved, only the buffer is removed.

`:bd` respects pinned tabs, `:bd!` overrides them and skips save.

Also refactors the tab switcher's close button to use the new
`close_items_with_project_path` method, removing duplicated logic.

Release Notes:

- Vim: `:bd` (`:bdelete`) now closes the file in all panes where it's
open
- Added `workspace::CloseItemInAllPanes` action to close a file across
all panes

Co-authored-by: David Baldwin <baldwindavid@gmail.com>
2026-02-12 12:33:51 +00:00
Richard Feldman
ee3f40fe25
Re-add MultiWorkspace (#48800)
Release Notes:

- Added agent panel restoration. Now restarting your editor won't cause
your thread to be forgotten.

---------

Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
Co-authored-by: Eric Holk <eric@zed.dev>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Anthony Eid <anthony@zed.dev>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Co-authored-by: Cameron Mcloughlin <cameron.studdstreet@gmail.com>
2026-02-12 01:06:23 +00:00
Mikayla Maki
83de8a25e0
Revert PRs for landing in main (#48969)
We're going to re-apply these after landing the multiworkspace branch.

Release Notes:

- N/A
2026-02-12 00:28:17 +00:00
Katie Geer
f233ae4c29
Add telemetry for user-facing notifications (#48558)
## Summary

Adds a "Notification Shown" telemetry event that fires whenever a
user-facing notification is displayed in Zed. This helps the team
understand error patterns, notification frequency, and which parts of
the application generate the most notifications.

## Event Schema

| Property | Type | Description |
|----------|------|-------------|
| `notification_type` | `string` | `"error"` or `"notification"` |
| `source` | `string` | Origin category (e.g., `lsp`, `git`, `settings`,
`editor`) |
| `lsp_name` | `string?` | Language server name (only for LSP
notifications) |
| `level` | `string?` | Severity: `"critical"`, `"warning"`, or `"info"`
|
| `has_actions` | `bool` | Whether the notification has action buttons |
| `notification_id` | `string` | Debug string of the NotificationId |
| `is_auto_dismissing` | `bool` | Whether the notification
auto-dismisses |

## NotificationSource Categories

A new `NotificationSource` enum categorizes notifications by origin:

- `lsp` - Language server notifications
- `settings` - Settings/keymap parse errors
- `update` - App updates, release notes
- `extension` - Extension suggestions/errors
- `git` - Git operations, commit errors
- `project` - Project-level issues
- `collab` - Collaboration notifications
- `remote` - SSH/remote project errors
- `file` - File access errors
- `editor` - Editor operations (search, encoding)
- `agent` - AI assistant notifications
- `cli` - CLI installation
- `system` - Generic fallback

## Privacy

**Message content is intentionally not included** in telemetry because:
- LSP messages come from external servers and may contain file paths or
error chains
- Error messages may contain sensitive paths or API-related information
- The metadata alone provides sufficient insight for error tracking

## Implementation

Updated function signatures to include `NotificationSource`:
- `show_notification(id, source, cx, build_fn)`
- `show_toast(toast, source, cx)`
- `show_error(err, source, cx)`
- `show_app_notification(id, source, cx, build_fn)`
- `notify_err(workspace, source, cx)`
- `notify_async_err(source, cx)`
- `notify_app_err(source, cx)`
- `detach_and_notify_err(source, window, cx)`

Release Notes

- N/A (internal telemetry change)

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-02-11 10:21:37 -08:00
Piotr Osiewicz
1176c39476
ci: Fix builds on Windows following mtime finnickery (#48878)
- **Revert "vim: Make `:bdelete` use new
`workspace::CloseItemInAllPanes` command (#48592)"**
- **Revert "linux: Forward env vars starting with ZED_ to flatpak-spawn
(#48118)"**
- **ci: Fix builds on hel1-windows-1**


- [x] Tests or screenshots needed?
- [x] Code Reviewed
- [x] Manual QA

Release Notes:

- N/A
2026-02-10 16:17:49 +01:00
David Baldwin
4911855194
vim: Make :bdelete use new workspace::CloseItemInAllPanes command (#48592)
Add `workspace::CloseItemInAllPanes` action that closes the active
item's buffer in every pane where it's open, matching Vim's `:bdelete`
semantics. Pane layout is preserved, only the buffer is removed.

`:bd` respects pinned tabs, `:bd!` overrides them and skips save.

Also refactors the tab switcher's close button to use the new
`close_items_with_project_path` method, removing duplicated logic.

Release Notes:

- Vim: `:bd` (`:bdelete`) now closes the file in all panes where it's
open
- Added `workspace::CloseItemInAllPanes` action to close a file across
all panes

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-02-10 14:32:24 +01:00
Dino
ad7b1f52b4
vim: Make end of line infallible (#48867)
When using `$` to move to the end of line (`vim::EndOfLine`), the
`vim::motion::Motion.move_point` method checks whether the new point,
that is, the point after the motion is applied is different from the
point that was passed as a method argument. If the point is not
different, the point and selection goals are only updated if
`vim::motion::Motion.infallible` returns true for the motion in
question.

In short, this means that, if the cursor was already at the end of the
line, and it got there using `vim::Right`, for example, the selection
goal wouldn't actually be set to
`SelectionGoal::HorizontalPosition(f64::INFINITY)`, so when the cursor
was moved to a shorter line, it wouldn't be set at the end of that line,
even though `$` had been used.

This commit updates `vim::motion::Motion.infallible` to ensure that, for
`vim::motion::Motion::EndOfLine`, it returns `true`, so that the
selection goal is always updated, regardless of whether the cursor is
already at the end of the line.

Closes #48855 

- [X] Tests or screenshots needed?
- [X] Code Reviewed
- [X] Manual QA

Release Notes:

- vim: Fixed `$` not sticking to end-of-line on vertical motions
(`j`/`k`) when the cursor was already at the end of the line via `l` or
arrow keys
2026-02-10 10:33:50 +00:00
Finn Evers
165b404460
Revert "New multi workspace (#47795)" (#48776)
Preparing this just in case.

Release Notes:

- N/A
2026-02-09 15:37:16 +01:00
Finn Evers
bdff8bf47c
Ensure proper workspace is used for various actions (#48767)
The multi workspace refactor **completely** broke the Vim mode, saving
is not possible, and various other actions. This PR fixes this

- [X] Code Reviewed
- [X] Manual QA

Release Notes:

- N/A
2026-02-09 10:33:36 +00:00
Mikayla Maki
1c21718587
New multi workspace (#47795)
It's happeningggggg

Release Notes:

- Changed the Agent Panel so that the Active Thread is restored on
restart.

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Anthony Eid <anthony@zed.dev>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Richard Feldman <richard@zed.dev>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-02-08 17:46:51 -08:00
Josh Robson Chase
c47430debf
helix: Fix line select with empty first line (#48026)
Release Notes:

- Fixed `HelixSelectLine` with an empty first line and a pre-existing
selection.

---------

Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
Co-authored-by: Lena Falk <lena@zed.dev>
2026-02-05 18:57:23 +01:00
lex00
2b5386b438
Fix vim increment/decrement on Markdown list markers (#47978)
`find_target()` failed to match numbers followed by a dot and a
non-digit (e.g. `1. item`), because the dot unconditionally reset
the scan state, discarding the number. Additionally, numbers at the
start of non-first lines were missed because the backward scan
stopped on the preceding newline and the forward scan immediately
broke on it.

Closes #47761

Release Notes:

- Fixed vim increment (`ctrl-a`) and decrement (`ctrl-x`) not working on Markdown ordered list markers like `1.`, `2.`, etc.

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-02-04 23:52:43 +00:00
Dino
18a0103112
vim: Add $ and = as subword motion boundaries (#48276)
These changes update subword motions in order to also take `$` and `=`
into consideration as stopping punctuation, improving the subword
motions for certain languages where `$` and `=` are commonly used, like
PHP, for variables and assignments.

Closes #48267 

Release Notes:

- Improved Vim's subword motions to stop at `$` and `=` characters
2026-02-04 23:38:00 +00:00
Lukas Wirth
5d2feaa144
editor: Implement semantic highlighting (#46356)
Part of #7450

Big thanks to @macmv for pushing this forwards so much!

Rebased version of https://github.com/zed-industries/zed/pull/39539 as
working on an in-org branch simplifies a lot of things for us)

Release Notes:

- Added LSP semantic tokens highlighting support

---------

Co-authored-by: Neil Macneale V <neil.macneale.v@gmail.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-02-04 17:37:13 +00:00
Conrad Irwin
2539ac0263
vim: Revert changes to search (#48127) (#48234)
Release Notes:

- (nightly only) Fixed vim search to be regex by default
2026-02-03 02:46:41 +00:00
Xiaobo Liu
f0c165ac41
vim: Refactor vim search settings test (#48165)
Release Notes:

- N/A

---------

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-02-02 16:24:37 +00:00
lex00
a4fe57d607
Fix vim method/comment navigation with expanded diff hunks (#47976)
Previously, `]m`/`[m` (method) and `]/`/`[/` (comment) motions would
navigate to incorrect positions when diff hunks were expanded. This was
caused by extracting raw `usize` values from `MultiBufferOffset` and
operating directly on the underlying buffer, which doesn't account for
expanded diff hunk content.

The fix properly uses `MultiBufferOffset` throughout and queries
`text_object_ranges` on the `MultiBufferSnapshot` instead of the
underlying buffer, ensuring correct coordinate mapping when diff content
is displayed inline.

Fixes #46612

Release Notes:

- Fixed vim method and comment navigation (`] m`, `[ m`, `] shift-m`, `[
shift-m`, `] /`, `[ /`) incorrectly positioning cursor when diff hunks
are expanded

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-02-02 13:49:28 +00:00
Xiaobo Liu
aafecf043a
vim: Respect search settings in buffer search (#48127)
Closes https://github.com/zed-industries/zed/issues/48007

Release Notes:

- Fixed Vim search not respecting `"search"` default settings

---------

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
2026-02-01 17:17:19 +02:00
Cole Miller
8d18b7b927
git: Fix desynced scrolling between LHS and RHS of side-by-side diff (#47913)
- Remove old attempt to sync scrolling
- Share a `ScrollAnchor` between the two sides, and be sure to resolve
it against the correct snapshot
- Allow either side to initiate an autoscroll request, and make sure
that request is processed in the same frame by the other side

Release Notes:

- N/A

---------

Co-authored-by: cameron <cameron.studdstreet@gmail.com>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
Co-authored-by: Jakub <jakub@zed.dev>
2026-01-31 18:33:22 +00:00
lex00
609e915b10
vim: Restore cursor position when dismissing buffer search (#47732)
Fixes #8048

## Summary

In vim mode, pressing Escape to dismiss the buffer search now correctly
restores the cursor to its original position, rather than leaving it at
the first match.

## Problem

When using vim's `/` command to search:
1. User positions cursor at line X
2. User presses `/` to open search, types a query
3. Matches are highlighted, cursor may visually jump to first match
4. User presses Escape to dismiss without navigating
5. **Bug:** Cursor ends up at first match instead of line X

This breaks vim parity where Escape should cancel the search and restore
cursor position.

## Solution

The fix leverages the `focused()` callback in `vim.rs`, which is called
when the editor regains focus after the search bar is dismissed.

**Key insight:** When search starts via `/`, the cursor position is
saved in `SearchState.prior_selections`. When search is *submitted* with
Enter, `search_submit()` drains these selections. But when search is
*dismissed* with Escape, they remain.

So in `focused()`, if:
- `prior_selections` is non-empty, AND
- The search bar's `is_dismissed()` returns true

...then we know the user dismissed the search (Escape) rather than
submitted it (Enter), and we restore the cursor.

## Why not handle `buffer_search::Dismiss` directly?

The initial approach tried to register a vim handler for the `Dismiss`
action. This didn't work because when Escape is pressed, the search bar
(which has focus) handles the `Cancel` action internally and calls its
`dismiss()` method directly—it doesn't dispatch `Dismiss` through the
action system. The vim handler registered on the editor was never
invoked.

## Test Plan

- Added `test_search_dismiss_restores_cursor` — verifies cursor
restoration when search is dismissed
- Added `test_search_dismiss_restores_cursor_no_matches` — verifies
behavior when query has no matches
- All 455 vim tests pass
- Manual testing confirms fix works with both `/` and `cmd-f`

## Release Notes

- Fixed vim mode: cursor now returns to original position when
dismissing buffer search with Escape (#8048)

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:59:38 -07:00
Xin Zhao
05a021c4a3
docs: Correct action descriptions to reflect actual purpose (#46931)
Thanks @injust for pointing this out. It seems a few other action docs
were also copied from elsewhere and weren't updated to reflect their
actual purpose. This PR fixes those, though I may not have covered all
of them.

Closes #46832

Release Notes:

- N/A

---------

Co-authored-by: Kunall Banerjee <hey@kimchiii.space>
2026-01-28 23:10:25 +00:00
Ran Benita
41ce23f896
vim: Add gdefault setting to set /g as a default substitution flag (#47664)
Add support for Vim's `gdefault` option which makes the `:substitute`
command replace all matches in a line by default, instead of just the
first match. When enabled, the `/g` flag inverts this behavior.

- Add `vim.gdefault` setting
- Add `:set gdefault`, `:set nogdefault` (and short forms `:set gd`, `:set nogd`)
- Fix handling of multiple `/g` flags so that each one inverts the one before

Closes #36209

Release Notes:

- vim: Add `vim.gdefault` setting to make `/g` (replace all matches in a line) the default for substitutions, along with `:set gdefault` and `:set nogdefault` commands (short forms: `gd`, `nogd`)

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-01-27 17:04:10 +00:00
lex00
9ecafe1960
vim: Ensure paragraph motions use empty and not blank lines (#47734)
The `}` and `{` paragraph motions now correctly treat only truly empty
lines (zero characters) as paragraph boundaries, matching vim's
documented behavior. Whitespace-only lines are no longer treated as
boundaries.

Changed `start_of_paragraph()` and `end_of_paragraph()` in
`editor/src/movement.rs` to check `line_len() == 0` instead of
`is_line_blank()`.

Note: This change does NOT affect the `ap`/`ip` text objects. Per vim's
`:help ap`, those DO treat whitespace-only lines as boundaries, which is
the existing (correct) behavior in `vim/src/object.rs`.

Closes #36171

Release Notes:

- Fixed vim mode paragraph motions (`}` and `{`) to correctly ignore
whitespace-only lines

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-01-27 13:33:53 +00:00
everdrone
c93773cfe5
Make workspace::SendKeystrokes not use layout key equivalents (#47061)
Closes #46509

Release Notes:

- Fixed: `workspace::SendKeystrokes` would not allow remapping keys in
different keyboard layouts

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2026-01-27 03:28:00 +00:00
Josh Robson Chase
d1f7c249b6
helix: Fix normal-mode selection expansion during vim::Scroll commands (#47024)
Fixes the `vim::ScrollUp/Down` commands when a normal-mode vim or helix
selection exists.

Pretty straightforward: make the `scroll_editor` function aware of the
current vim/helix mode, and only expand the selection if a visual mode
is active.

Closes #47022

Release Notes:

- Fixed bug causing normal-mode vim/helix selections to get expanded
during `vim::Scroll` commands

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-01-26 19:54:02 +00:00
Piotr Osiewicz
515a840e76
build: Bump Rust version to 1.93 (#47358)
Release Notes:

- N/A

---------

Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
2026-01-23 13:22:41 +01:00
MostlyK
d42fe0bba4
Fix Visual mode flip on project search (#44284)
Previously, when project search results first appeared, vim would
incorrectly switch to Visual mode. This happened because vim settings
(including `collapse_matches`) weren't synced to an editor until it
received focus. Since the results editor wasn't focused when the first
match was selected, the selection wasn't collapsed, causing vim to
interpret it as a visual selection.

Now vim settings are synced immediately when vim activates on an editor,
ensuring `collapse_matches` is set before any selections are made.

Closes #43878

Release Notes:

- Fixed vim mode incorrectly switching to Visual mode on first project
search

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-01-22 00:11:29 +00:00
Lukas Wirth
d092f3a41b
text: Speed up offset_for_anchor and fragment_id_for_anchor conversions (#46989)
And most importantly, speed `Anchor::cmp` by doing so.

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-01-16 15:23:57 +00:00
Ben Kunkle
a2728e39a8
Split settings content into its own crate (#46845)
Closes #ISSUE

Moves the settings content definitions into their own crate, so that
they are compiled+cached separately from settings, primarily to avoid
recompiles due to changes in gpui. In that vain many gpui types such as
font weight/features, and `SharedString` were replaced in the content
crate, either with `*Content` types for font/modifier things, or
`String`/`Arc<str>` for `SharedString`. To make the conversions easy a
new trait method in the settings crate named `IntoGpui::into_gpui`
allows for `into()` like conversions to the gpui types in
`from_settings` impls.

Release Notes:

- N/A

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2026-01-15 18:10:21 +00:00
Lionel Henry
b5242ab5f2
vim: Fix subword motion near end of line (#45908)
Fixes subword motion incorrectly jumping to next line when near end of
line. Updates boundary detection to use exclusive boundaries with
need_next_char parameter, matching regular word motion behavior.
Refactors word and subword motion to share boundary detection logic.

Closes #17780

Release Notes:

- Fixed subword motion incorrectly jumping to the next line when near
the end of a line

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-01-14 10:55:15 +00:00
everdrone
5be4b60176
Customizable vim mode text color (#46639)
Release Notes:
- Added ability to customize vim mode foreground

---

<video
src="https://github.com/user-attachments/assets/776ecfcd-9600-4a04-b3cf-e78af439aab2"
/>
2026-01-13 15:38:13 -06:00
Ben Kunkle
eed80aaef6
settings_ui: Add vim settings (#46634)
Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-01-13 14:52:44 -05:00