Conrad Irwin
966514066d
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/2751970cf856909897c6f3005536387ae4cbe606/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
349b9a73e1
Add support for u and U in vim visual mode
2024-01-28 15:13:09 -05:00
Brian Strauch
855f068364
add test_data
2024-01-26 20:02:59 -08:00
Conrad Irwin
17bb566768
Work on tests
2024-01-21 22:00:35 -07:00
Conrad Irwin
24e1246e74
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
Conrad Irwin
ee7b749e75
Fix some cases of broken repeat in vim
2024-01-18 13:20:08 -07:00
Conrad Irwin
3227c45af6
Fix neovim tests with angle brackets
2023-10-22 22:24:35 -06:00
Conrad Irwin
70441d86fe
Add | as a bracket and a motion
...
Although vim/nvim doesn't have | as brackets, it's common in langauges like Rust
and Ruby, and I expect it to work.
2023-10-22 22:17:34 -06:00
Conrad Irwin
92e91e5b45
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
83d315d720
Fix single column vim selections
2023-10-20 11:17:19 -06:00
Conrad Irwin
fbbf36d152
Merge branch 'main' into pixel-columns
2023-10-18 23:00:56 -06:00
Conrad Irwin
7436ed4d45
Make vim visual block work better
2023-10-18 22:23:06 -06:00
Conrad Irwin
ccc2c5fdd6
Use Horizontal ranges everywhere
2023-10-09 21:48:50 -06:00
Conrad Irwin
03d8021662
Don't wrap on paragraphs
...
For zed-industries/community#2116
2023-10-06 10:32:15 -06:00
Conrad Irwin
f1dc4708ff
Clear SelectionGoal on input
2023-10-05 09:02:52 -06:00
Conrad Irwin
b3ed440e5c
Fix panic in increment
2023-10-04 15:13:01 -06:00
Conrad Irwin
d0e5c86d31
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
43eda76653
vim increment ( #3054 )
...
- vim: add ctrl-a/ctrl-x for increment/decrement
2023-09-28 15:32:11 -06:00
Conrad Irwin
98914f1155
vim: Fix some dw edge cases
2023-09-27 23:09:09 -06:00
Conrad Irwin
a9f0d72019
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
6ca8f83ef0
ctrl-a/x for vim
2023-09-27 12:32:01 -06:00
Conrad Irwin
6fd4a8fcba
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
89c569e0b1
Fix backward search from command
2023-09-20 20:44:42 -06:00
Conrad Irwin
e85104ab0b
Iron out some edge-cases
2023-09-20 20:44:42 -06:00
Conrad Irwin
12cbf801f3
Flesh out v1.0 of vim :
2023-09-20 20:44:41 -06:00
Conrad Irwin
20ad2c41c8
Fix vim test recording
2023-09-20 12:01:04 -06:00
Conrad Irwin
4a5e44a9ef
Fix vim panic when over-shooting with j
2023-09-20 11:20:35 -06:00
Conrad Irwin
a22d09c9d7
Fix Y on last line with no trailing new line
...
For zed-industries/community#2044
2023-09-15 11:14:04 -06:00
Conrad Irwin
488b325f60
Fix 0 used in a count
2023-09-12 09:56:23 -06:00
Conrad Irwin
d0497dfdb7
Clear counts when switching modes
2023-09-11 18:30:31 -06:00
Conrad Irwin
b850e0b8a6
vim: ALlow counts on insert actions
...
This re-uses the existing repeat infrastructure.
2023-09-11 18:09:47 -06:00
Conrad Irwin
4aa2148f76
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
cec47cb01a
vim . to replay ( #2936 )
...
Release Notes:
- vim: Add `.` to replay
([#946 ](https://github.com/zed-industries/community/issues/946 ))
- vim: Fix `J` in visual mode, and with counts.
2023-09-08 11:52:35 -06:00
Conrad Irwin
298d072b93
Fix f,t on soft-wrapped lines
...
Also remove the (dangerously confusing) display_map.find_while
2023-09-08 10:16:46 -06:00
Conrad Irwin
1fb1c40f22
add vim-specific J (with repeatability)
2023-09-07 11:08:07 -06:00
Conrad Irwin
17c2ee6ed1
Add visual area repeating
2023-09-07 10:45:38 -06:00
Conrad Irwin and
204e716a5d
vim . to replay
...
Co-Authored-By: maxbrunsfeld@gmail.com
2023-09-06 13:49:55 -06:00
Conrad Irwin
475925ea6c
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
48a79db963
vim: Add S to substitute line
...
For zed-industries/community#1897
2023-09-01 13:13:59 -06:00
Conrad Irwin
d614796305
Fix find_{,preceding}boundary to work on buffer text
...
Before this change the bounday could mistakenly have happened on a soft
line wrap.
Also fixes interaction with inlays better.
2023-08-29 18:03:29 -07:00
Conrad Irwin
b7fde801d7
A few more fixes for wrapped line motions
2023-08-25 14:40:04 -06:00
Conrad Irwin
389a5ebabc
vim: Fix relative line motion
...
Before this change up and down were in display co-ordinates, after this
change they are in fold coordinates (which matches the vim behaviour).
To make this work without causing usabliity problems, a bunch of extra
keyboard shortcuts now work:
- vim: `z {o,c}` to open,close a fold
- vim: `z f` to fold current visual selection
- vim: `g {j,k,up,down}` to move up/down a display line
- vim: `g {0,^,$,home,end}` to get to start/end of a display line
Fixes : zed-industries/community#1562
2023-08-25 14:40:04 -06:00
Conrad Irwin
c591a6b231
Fix zed-industries/community#1950
2023-08-25 11:34:07 -06:00
Conrad Irwin
4a80e136c9
vim: Fix linewise copy of last line with no trailing newline
...
Along the way, delete the VimBindingTestContext by updating the
visual tests to no-longer need it.
2023-08-24 00:00:12 -06:00
Conrad Irwin
21b6d69d61
Rewrite paste
...
- vim: support P for paste before
- vim: support P in visual mode for paste without overriding clipboard
- vim: fix position when using `p` on text copied outside zed
- vim: fix indentation when using `p` on text copied from zed
2023-08-22 13:27:57 -06:00
Conrad Irwin
08aa9b95b9
Fix <Enter> to go to non-whitespace character
...
Fixes : zed-industries/community#831
2023-08-18 12:24:39 -06:00
Conrad Irwin
9f6567f2a9
Fix visual objects
...
Adds 'a'/'i' in visual mode
2023-08-17 17:13:23 -06:00
Conrad Irwin
82b40f4136
Fix edge-cases in visual block insert
2023-08-17 15:16:26 -06:00
Conrad Irwin
03e0c6d2d6
Tidy-up
2023-08-16 22:29:28 -06:00
Conrad Irwin
d37246dee7
Vim visual block mode
...
This isn't quite an exact emulation, as instead of using one selection
that is magically in "column mode", we emulate it with a bunch of zed
multi-selections (one per line).
I think this is better, as it requires fewer changes to the codebase,
and lets you see the impact of any changes immediately on all lines.
Fixes : zed-industries/community#984
2023-08-15 16:00:50 -06:00