Release Notes:
- vim: Added `-`/`+` to go to beginning of line above/below
([#14183](https://github.com/zed-industries/zed/issues/14183)).
- vim: (Breaking) Removed non-standard builtin binding from `-` to open
the project panel. You can re-add it to your keymap file with:
`{"context":"VimControl", "bindings":{ "-":
"pane::RevealInProjectPanel"}}`
Optionally, include screenshots / media showcasing your addition that
can be included in the release notes.
https://github.com/zed-industries/zed/assets/32429059/0e9e9348-265e-4a81-a45a-4739034dc5d9
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Release Notes:
- vim: (BREAKING) Improved vim keymap contexts.
Previously `vim_mode == normal` was true even when operators were
pending, which led to bugs like #13789 and a requirement for custom
keymaps to exclude various conditions like (`!VimObject` and
`!VimWaiting`) to avoid bugs.
Now `vim_mode` will be set to `operator` or `waiting` in these cases as
described in [the docs](https://zed.dev/docs/vim#keybindings). For most
custom keymaps this change will be a no-op or an improvement, but if you
were deliberately relying on the old behaviour (if you were relying on
`VimObject` or `VimWaiting` becoming true) you will need to update your
keymap.
---------
Co-authored-by: Thorsten <thorsten@zed.dev>
For: #13417
This is a simple version, I'm not sure if we just need to limit this
feature to vim mode, or maybe in normal editor mode, which involves
other logic like the location of the setting
Release Notes:
- N/A
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This is related to #9428
I noticed that doing a search and replace for the beginning of a line
`^` results in the trailing line being included in the search. This
seems to be because of the way the range is generated for generating
matches being the up to the start of the trailing line rather than up to
the end of the last line.
I added a test and took a stab at fixing it but it is a bit yolo as this
is the first time I've seen this codebase.
These were previously passed directly to the editor module, which knows
nothing about vim counts. Instead, implement new actions in the vim
module which take the count and use it to invoke the corresponding
action in the editor module, properly repeated.
Release Notes:
- Fixed vim undo and redo commands not taking counts.
Fixing the "r" action just involved adapting `normal_replace` to replace
multiple characters.
Fixing the "shift-r" command was less straightforward. The bindings for
`vim::BeforeNormal` in replace mode were being overwritten and several
other steps required for action repetition were not performed. Finally,
the cursor adjustment after re-entering normal mode was duplicated
(`vim::BeforeNormal` was now triggered correctly) so I removed the
special case for replace mode.
Release Notes:
- Fixed vim "r" action to accept a count argument
- Fixed vim "shift-r" action to accept a count argument and allow
repetition
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Adds support for surrounding text in visual/visual-line/visual-block
mode by re-using the `AddSurrounds` operator. There is no default
binding though so the user must follow the instructions to enable it.
Note that the behaviour varies slightly for the visual-line and
visual-block modes. In visual-line mode the surrounds are placed on
separate lines (the vim-surround extension also indents the contents but
I opted not to as that behaviour is less important with the use of code
formatters). In visual-block mode each of the selected regions is
surrounded and the cursor returns to the beginning of the selection
after the action is complete.
Release Notes:
- Added action to surround text in visual mode (no default binding).
Fixes#13122
![result](https://github.com/zed-industries/zed/assets/32017007/c400081f-be5d-48fa-994f-90a00e2be359)
In the past, Zed used a single switch called `autoclose` to control both
`autoclose` and `auto_surround` functionalities:
+ `autoclose`: when input '(', append ')' automatically.
+ `auto_surround`: when select text and input '(', surround text with
'(' and ')' automatically.
This PR separates `auto_surround` from `autoclose` to support `<`.
Previously, if `autoclose` of `<` was set to `false`, `auto_surround`
couldn't be used. However, setting `autoclose` to `true` would affect
the default behavior of simple expression. For example, `a < b` would
become `a <> b`.
For more information, see #13187.
Fix#12898.
Release Notes:
- Added support for `auto_surround`
([#12898](https://github.com/zed-industries/zed/issues/12898)).
Co-Authored-By: Richard <richard@zed.dev>
Release Notes:
- vim: Fixed behavior of `dw` at the end of a soft wrapped line
Co-authored-by: Richard <richard@zed.dev>
Release Notes:
- vim: Fix `gi` when the insert ended at the end of a line (#12162)
- vim: Add `gv` to restore previous visual selection (#12888)
- vim: Fix `gl` when the first match is at the end of a line
Note:
- We have disabled all tests that rely on Postgres in the Linux CI. We
only really need to test these once, and as macOS is our team's primary
platform, we'll only enable them on macOS for local reproduction.
- We have disabled all tests that rely on the font metrics. We
standardized on Zed Mono in many fonts, but our CoreText Text System and
Cosmic Text System proved to be very different in effect. We should
revisit if we decide to standardize our text system across platforms
(e.g. using Harfbuzz everywhere)
- Extended the condition timeout significantly. Our CI machines are slow
enough that this is causing spurious errors in random tests.
Release Notes:
- N/A
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
TODO:
- [x] Finish GPUI changes on other operating systems
This is a largely internal change to how we report data to our
diagnostics and telemetry. This PR also includes an update to our blade
backend which allows us to report errors in a more useful way when
failing to initialize blade.
Release Notes:
- N/A
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
I'm not a huge fan of passing around a boolean all around the place, but
this will tame the events for now until we have a better solution.
Release Notes:
- N/A
This changes the vim::MoveToNextMatch event callback to open the
buffer_search toolbar. This fixes an issue where highlights would appear
which were only cancellable by opening then closing the toolbar.
Release Notes:
- the buffer search toolbar now opens on vim::MoveToNextMatch fixing the
issue where highlights were not cancellable
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Fixes a bug where Vim bindings would flash in the mouse context menu and
then be replaced by the default keybindings. Also fixes those bindings
not being usable while the mouse context menu was open.
Release Notes:
- Fixed bug where Vim bindings were not available when mouse context
menu was open
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This cleans up the neovim-backed vim tests:
- removed exempted tests (we'll rely on bug reports to find missing edge
cases)
- moved all assertions into non-async fn's so that failures are
reporting on the right file/line
- removed the NeovimBackedBindingTestContext
- renamed a few things to make them clearer
- reduced the number of permutations tested in some cases to reduce
slowest test from 60s to 5s
Release Notes:
- N/A
Part of https://github.com/zed-industries/zed/issues/8081
To avoid confusion and bugs when converting between various row `u32`'s,
use different types for each.
Further PRs should split `Point` into buffer and multi buffer variants
and make the code more readable.
Release Notes:
- N/A
---------
Co-authored-by: Piotr <piotr@zed.dev>
Release Notes:
- vim: Added support for the changelist. `g;` and `g,` to the
previous/next change
- vim: Added support for the `'.` mark
- vim: Added support for `gi` to resume the previous insert
Release Notes:
- vim: Added support for buffer-local marks (`'a-'z`) and some builtin
marks `'<`,`'>`,`'[`,`']`, `'{`, `'}` and `^`. Global marks (`'A-'Z`),
and other builtin marks (`'0-'9`, `'(`, `')`, `''`, `'.`, `'"`) are not
yet implemented. (#5122)
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
For #11084 In the case of an indentation in front of the current line,
it may also be necessary to deal with the start point of the selected
range
Release Notes:
- N/A
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Release Notes:
- Added support for line ranges in vim replace commands #9428
- not supporting anything other than bare line numbers right now
- ~need to figure out how to show range in question in search bar~
@ConradIrwin implemented showing a highlight of the selected range for a
short direction instead
- ~tests lol~