Commit Graph
122 Commits
Author SHA1 Message Date
Marshall Bowers 9735912965 Enable clippy::clone_on_copy (#8728)
This PR enables the
[`clippy::clone_on_copy`](https://rust-lang.github.io/rust-clippy/master/index.html#/clone_on_copy)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 17:37:48 -05:00
Marshall Bowers 5935681c5c Enable clippy::single_char_pattern (#8727)
This PR enables the
[`clippy::single_char_pattern`](https://rust-lang.github.io/rust-clippy/master/index.html#/single_char_pattern)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 17:04:59 -05:00
Mahdy M. KaramandConrad Irwin 5c4f3c0cea Add option to either use system clipboard or vim clipboard (#7936)
Release Notes:

- vim: Added a setting to control default clipboard behaviour. `{"vim":
{"use_system_clipboard": "never"}}` disables writing to the clipboard.
`"on_yank"` writes to the system clipboard only on yank, and `"always"`
preserves the current behavior. ([#4390
](https://github.com/zed-industries/zed/issues/4390))

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-02-22 10:12:29 -07:00
Conrad IrwinandWindSoilder 3635d2dced Highlight selections on vim yank (#7638)
Fixes: #7311

Co-Authored-By: WindSoilder <WindSoilder@outlook.com>

Release Notes:

- Added a highlight on yanked text in vim normal mode

**or**

- N/A

Co-authored-by: WindSoilder <WindSoilder@outlook.com>
2024-02-09 16:18:09 -07:00
f09da1a1c8 vim hml (#7298)
- Add a setting for `vertical_scroll_offset`
- Fix H/M/L in vim with scrolloff



Release Notes:

- Added a settings for `vertical_scroll_offset`
- vim: Fix H/M/L with various values of vertical_scroll_offset

---------

Co-authored-by: Vbhavsar <vbhavsar@gmail.com>
Co-authored-by: fdionisi <code@fdionisi.me>
2024-02-02 19:24:36 -07:00
Conrad Irwin 331b6e7e6e Support "dtx" vim key combination when "x" is immediately to the right of the cursor (#6830)
Closes #4358

The bug originates on this line:
https://github.com/zed-industries/zed/blob/5db7e8f89ee4f5d9801a2eab88adc1db3fda0f46/crates/vim/src/motion.rs#L451

- When running "dtx" on "ˇabcx", the range to delete is 0 -> 2 ("abc")
- When running "dtx" on "abˇcx", the range to delete is 2 -> 2 ("c"), so
`new_point == point` and the function incorrectly returns `None` and "c"
is not deleted
- We need to disambiguate between the "not found" case and the "found
immediately to the right" case
- This bug does not apply to the backwards case ("dTx")

Release Notes:
- Fixed "dtx" vim key combination when "x" is immediately to the right
of the cursor (#4358)
2024-01-28 19:46:14 -07:00
Brooks Swinnerton 52f7f2d770 Update name of function to match other implementation 2024-01-28 15:20:50 -05:00
Brooks Swinnerton c0c0abae56 Add support for u and U in vim visual mode 2024-01-28 15:13:09 -05:00
Brian Strauch f369e9a48b vim: fix dtx when x is immediately to the right 2024-01-26 16:58:48 -08:00
Thorsten Ball 29e74a648f When searching in visual mode switch to normal mode (#4178)
This matches Neovim behaviour by setting the mode to `Normal` when using
search while in visual mode.

Release Notes:

- Fixed Vim mode not switching to normal mode from visual mode when
using search (`/`) while in visual mode.
2024-01-21 08:42:47 +01:00
Mikayla 4184686e8d Lock down test platform implementation 2024-01-20 15:03:36 -08:00
Thorsten BallandConrad 87be105af7 When searching in visual mode switch to normal mode
This matches Neovim behaviour by setting the mode to `Normal` when using
search while in visual mode.

Co-authored-by: Conrad <conrad@zed.dev>
2024-01-20 16:33:07 +01:00
Conrad Irwin 137e219830 Don't toggle WHOLE_WORD in vim search (#4165)
Fixes */# in visual mode, and avoids setting up irritating state.

[[PR Description]]

Release Notes:

- vim: Improved `*` and `#` to not toggle Zed's search state. Instead we
now use the regex to identify start and end of words (more like vim).
2024-01-19 15:02:38 -07:00
Conrad Irwin 0479ebc26d Don't toggle WHOLE_WORD in vim search
Fixes */# in visual mode, and avoids setting up irritating state.
2024-01-19 10:58:55 -07:00
Max Brunsfeld b65cf6d2d9 Merge branch 'main' into language-api-docs 2024-01-18 15:06:45 -08:00
Conrad Irwin 4e118f3dd7 Fix some cases of broken repeat in vim 2024-01-18 13:20:08 -07:00
Mikayla Maki aa7351041d Add typo detection to CI (#4107)
Adding the typos crate to our CI will take some doing, as we have
several tests which rely on typos in various ways (e.g. checking state
as the user types), but I thought I'd take a first stab at fixing what
it finds.

Release Notes:

- N/A
2024-01-17 17:13:47 -08:00
Piotr OsiewiczandKirill 6cbc49e5f0 Editor docs (#4097)
Release Notes:

- N/A

---------

Co-authored-by: Kirill <kirill@zed.dev>
2024-01-18 00:48:37 +01:00
Mikayla 57400e9687 Fix typos detected by crate-ci/typos 2024-01-17 14:31:21 -08:00
Max BrunsfeldandMikayla 252694390a Remove 2 suffix for vim, diagnostics, go_to_line, theme_selector, command_palette, file_finder
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 10:42:49 -08:00
Conrad Irwin 9589f5573d Fix some bugs with vim objects
- softwrap interaction
- correct selection if cursor is on opening marker
2023-10-22 21:44:34 -06:00
Conrad Irwin 1c36134cf9 Fix single column vim selections 2023-10-20 11:17:19 -06:00
Conrad Irwin 3eb8aa8085 Refactor TextLayoutDetails construction 2023-10-18 22:56:11 -06:00
Conrad Irwin ab050d1890 Use Horizontal ranges everywhere 2023-10-09 21:48:50 -06:00
Conrad Irwin ef7e2c5d86 Get the project running! 2023-10-09 21:48:31 -06:00
Conrad Irwin a4e77af571 Fix panic in increment 2023-10-04 15:13:01 -06:00
Conrad Irwin e7ee8a95f6 vim: Fix some dw edge cases (#3058)
Release Notes:

- vim: Fix `dw` on the last word of a line, and on empty lines.
2023-09-28 15:32:29 -06:00
Conrad Irwin 2f5eaa8475 vim increment (#3054)
- vim: add ctrl-a/ctrl-x for increment/decrement
2023-09-28 15:32:11 -06:00
Conrad Irwin 768c991909 vim: Fix some dw edge cases 2023-09-27 23:09:09 -06:00
Conrad Irwin dd1cf5c3cf vim: add ctrl-a/ctrl-x
For zed-industries/community#1411
For zed-industries/community#619
2023-09-27 19:49:31 -06:00
Conrad Irwin 25429f760c ctrl-a/x for vim 2023-09-27 12:32:01 -06:00
Conrad Irwin 8e1bbf32be vim: Fix ctrl-u/ctrl-d
They should work by exactly half a screen, and also move the cursor.
2023-09-26 22:28:04 -06:00
Conrad Irwin 32f8733313 Code review changes 2023-09-20 21:29:45 -06:00
Conrad Irwin a59da3634b Fix backward search from command 2023-09-20 20:44:42 -06:00
Conrad Irwin a25fcfdfa7 Iron out some edge-cases 2023-09-20 20:44:42 -06:00
Conrad Irwin 2d9db0fed1 Flesh out v1.0 of vim : 2023-09-20 20:44:41 -06:00
Kirill Bulatov 890a587254 Use standalone inlay background highlights 2023-09-14 22:08:12 +03:00
Conrad Irwin 0958def770 Remove another supported exemption 2023-09-12 12:48:36 -06:00
Conrad Irwin dcaba9d9e7 Remove supported exception
(and refactor tests to be more linear)
2023-09-12 10:13:24 -06:00
Conrad Irwin 7daed1b2c3 Fix 0 used in a count 2023-09-12 09:56:23 -06:00
Conrad Irwin c2c521015a Fix bug where cursors became invisible if replaying was interrupted 2023-09-11 20:56:22 -06:00
Conrad Irwin d868d00985 vim: ALlow counts on insert actions
This re-uses the existing repeat infrastructure.
2023-09-11 18:09:47 -06:00
Conrad Irwin cee549e1ef vim: Fix count handling to allow pre/post counts
Fixes 2yy, d3d, etc.

For zed-industries/community#970
For zed-industries/community#1496
2023-09-11 14:35:47 -06:00
Conrad Irwin 88dae22e3e Don't replay ShowCharacterPalette 2023-09-08 11:35:00 -06:00
Conrad Irwin 1b1d7f22cc Add visual area repeating 2023-09-07 10:45:38 -06:00
Conrad Irwin f22d53eef9 Make test more deterministic
Otherwise these pass only when --features=neovim is set
2023-09-06 14:14:49 -06:00
Conrad Irwinand 20f98e4d17 vim . to replay
Co-Authored-By: maxbrunsfeld@gmail.com
2023-09-06 13:49:55 -06:00
Conrad Irwin c2c04616b4 vim S (#2929)
Release Notes:
- vim: Add `S` to substitute line ([#1897](https://github.com/zed-industries/community/issues/1897)).
2023-09-05 09:39:08 -06:00
Conrad Irwin 55dd0b176c Use consistent naming 2023-09-02 19:52:18 -06:00
Conrad Irwin af12977d17 vim: Add S to substitute line
For zed-industries/community#1897
2023-09-01 13:13:59 -06:00