Commit Graph
74 Commits
Author SHA1 Message Date
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 8415926840 Hide any circumstantial evidence that this didn't work perfectly first
time
2023-10-20 14:45:37 -06:00
Conrad Irwin 7186969334 Fix bug in vim visual block mode 2023-10-20 11:49:10 -06:00
Conrad Irwin 83d315d720 Fix single column vim selections 2023-10-20 11:17:19 -06:00
Conrad Irwin 3d5cbcaad1 Refactor TextLayoutDetails construction 2023-10-18 22:56:11 -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 a1ae399638 Get the project running! 2023-10-09 21:48:31 -06:00
Conrad Irwin 3b6bb008b6 vim: Add multicursor shortcuts
- g n / g N to select next/previous
- g > / g < to select next/previous replacing current
- g a to select all matches
2023-09-25 15:32:03 -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 17c2ee6ed1 Add visual area repeating 2023-09-07 10:45:38 -06:00
Conrad Irwinand 204e716a5d vim . to replay
Co-Authored-By: maxbrunsfeld@gmail.com
2023-09-06 13:49:55 -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
Max Brunsfeld 0596c2f103 Format let-else statements 2023-08-25 10:11:32 -07:00
Mikayla Maki c4e7adf6f0 Introduce channel notes (#2880)
![Screen Shot 2023-08-24 at 5 26 53
PM](https://github.com/zed-industries/zed/assets/326587/3e84c5a6-1aaf-4335-a880-4c32eb83332d)

### Todo

* [x] Snapshot channel buffers when everyone closes the buffer
* [x] Ensure that users who are in both a project and a channel note
have the same color in both places
* [x] Allow following project collaborators into channel notes
* [x] Expose notes for the current channel under "Current Call" section
of the collaboration panel
* [x] Offline state for the channel notes view
* [x] Make the channel context menu accessible to all members (to expose
the notes)
* [x] Wire in view and Item method overrides

Release Notes:

- N/A
2023-08-24 18:01:28 -07:00
Max BrunsfeldandMikayla 90b815e2f9 Make channel notes view searchable and navigable via pane history
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-08-24 17:18:18 -07: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 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 03c12decbc Store some vim state per-editor
This fixes a bug where opening and closing command would reset your
selection incorrectly.
2023-08-17 14:09:47 -06:00
Conrad Irwin 03e0c6d2d6 Tidy-up 2023-08-16 22:29:28 -06:00
Conrad Irwin 17f8742a27 Disable autoindent in visual block insert mode 2023-08-16 10:44:59 -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
Conrad Irwin 99321c01b7 Add a VisualBlock mode
Instead of trying to extend the Mode::Visual special case, just split
out into three different modes.
2023-08-15 10:00:45 -06:00
Conrad Irwin 9fa277f4b3 TEMP 2023-08-02 15:06:46 +01:00
Conrad Irwin 2921cd77ca Fix visual selection of trailing newline 2023-07-28 22:38:39 -06:00
Conrad Irwin e6f1a6f9a9 Merge VisualChange -> Substitute
They both are supposed to work the same.
2023-07-28 15:32:02 -06:00
Conrad Irwin 29b0f54255 Add o/O for flipping selection 2023-07-28 15:26:40 -06:00
Conrad Irwin 35e3b03af6 Fix crash when deleting a long line in visual line mode 2023-07-28 15:26:40 -06:00
Conrad Irwin adc89d3418 Add support for visual ranges ending with a newline
These primarily happen when first entering visual mode, but can also
be created with objects like `vi{`.

Along the way fix the way ranges like `vi{` are selected to be more
similar to nvim.
2023-07-28 15:26:40 -06:00
Conrad IrwinandMax Brunsfeld 737efc0c9d Fix vim selection to include entire range
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2023-07-28 15:26:40 -06:00
Julia ba89ca0ddb Avoid panic from assuming a vim operator exists on the operator stack 2023-07-21 14:25:30 -04:00
Conrad Irwin 81edc7afc5 vim: Fix 1G
Before this change code could not distinguish between a user providing a
count of 1 and no count at all.

Fixes: zed-industries/community#710
2023-06-22 12:11:14 -06:00
Antonio Scandurra 8b5cdda569 Initialize the active editor when vim mode is enabled
Instead of waiting for a focus event. This makes more tests pass.
2023-04-20 14:02:40 -06:00
Nathan Sobo d8eb1ac343 WIP 2023-04-12 10:07:17 -06:00
Nathan Sobo f9dfc9ad08 Fix broken test due to trimmed trailing whitespace during formatting 2023-04-06 16:10:39 -06:00
Nathan Sobo d937660683 Merge MutableAppContext into AppContext
There may have been a good reason for the difference at some point, or I was
still learning Rust. But now it's just &mut AppContext vs &AppContext.
2023-04-06 15:49:03 -06:00
Kay Simmons 3e152b5d33 wip 2023-02-16 12:23:45 -08:00
Kay Simmons ab5653a76f More vim fixes and move some more things out of app.rs 2023-02-13 13:50:37 -08:00
Kay Simmons aef8027049 fix replace in normal and visual modes 2023-01-11 14:57:40 -08:00
Kay Simmons 974b07e043 in progress 2023-01-11 12:10:55 -08:00
Kay Simmons acac7d292d Refactor editor scrolling and implement scroll commands from vim mode 2022-12-07 16:39:32 -08:00
Max Brunsfeld 38699bcbb0 Implement Copy for multibuffer anchors 2022-11-28 14:18:49 -08:00
Mikayla Maki df62cba2ef Tried alternate stratergy 2022-11-08 11:54:26 -08:00
Kay Simmons 404f51643c fix some vim mode bugs around deletions and failed motions 2022-11-02 01:20:11 -07:00
K Simmons 4d285aee6f Add count argument to motion functions and add ability to jump to a given line 2022-10-11 16:27:54 -07:00
K Simmons edc2c90c3e working quote and bracket text objects 2022-10-11 15:17:29 -07:00
K Simmons 1236704bc9 Add some tests for portions of visual text objects. Note: they are slightly broken currently as described in the tests 2022-10-10 15:32:12 -07:00