Keith Simmons
c4b0a60808
Remove unused context_menu file in rust crate
2022-05-27 11:32:15 -07:00
Keith Simmons
d741fd09cf
Track selection changes in mutable selections collection
2022-05-26 17:02:05 -07:00
Max Brunsfeld and Keith Simmons
f7a49efb59
Avoid switching to visual mode when following in vim mode
...
Co-authored-by: Keith Simmons <keith@zed.dev >
2022-05-26 17:02:05 -07:00
Keith Simmons
2d611cb251
Fixup paste locations
2022-05-26 17:02:05 -07:00
Keith Simmons
d5178a27f9
fix bug in marked_range utils
2022-05-26 17:02:05 -07:00
Keith Simmons
f39925f024
WIP
2022-05-26 17:02:05 -07:00
Keith Simmons
b0c5ac1f54
Unify visual line_mode and non line_mode operators
2022-05-26 17:02:05 -07:00
Keith Simmons
f053c479e9
Visual line mode handles soft wraps
2022-05-26 17:02:05 -07:00
Keith Simmons
36fa835664
Enable copy and paste in vim mode
2022-05-26 17:02:05 -07:00
Keith Simmons
bdfa7200b9
WIP copy on delete
2022-05-26 17:02:05 -07:00
Keith Simmons
a66cc7c40b
Working change and delete in line mode
2022-05-26 17:02:05 -07:00
Keith Simmons
be8bfa9592
WIP line mode operations
2022-05-26 17:02:05 -07:00
Max Brunsfeld
d14224a54d
Merge pull request #1027 from zed-industries/missing-menu-commands
...
Add missing File menu commands, improve handling of unsaved multibuffers
2022-05-23 21:29:32 -07:00
Max Brunsfeld and Nathan Sobo
65c8bea372
Distinguish between singleton and non-singleton workspace items
...
* Prompt to save singleton items before non-singleton ones
* Don't prompt to save multi-buffers if they contain excerpts to items that are open elsewhere and not being closed.
Co-authored-by: Nathan Sobo <nathan@zed.dev >
2022-05-23 16:03:00 -07:00
Max Brunsfeld
259d76aa40
Start work on handling multibuffers properly when closing unsaved buffers
2022-05-22 16:48:33 -07:00
Antonio Scandurra
1fb594a0ac
Clear multi-buffer redo stack when pushing transaction onto undo stack
2022-05-22 10:44:32 +02:00
Max Brunsfeld
6082282925
Add "New Window" command
2022-05-20 11:01:20 -07:00
Max Brunsfeld
8b5b908985
Merge pull request #1023 from zed-industries/app-menu-improvements
...
Correctly populate application menus' keystrokes and enabled status
2022-05-20 10:22:20 -07:00
Max Brunsfeld
e6011794ca
Remove AppState from workspace actions
...
This allows those actions to be bound to keystrokes in the keymap.
Also, remove the WorkspaceParams struct, simplify how Workspaces are
constructed.
2022-05-19 14:37:26 -07:00
Keith Simmons
4ba404bc74
Clone selections on editor split
2022-05-19 11:22:53 -07:00
Antonio Scandurra
65d11f89f4
Bump FoldSnapshot version if excerpt gets edited outside of its bounds
...
This will cause layers above `FoldMap` to grab a fresh snapshot of the `FoldMap`
and, as a result, of the underlying `MultiBufferSnapshot`. It is a necessary change
because, even though the coordinate space is not affected, a buffer edit taking place
*before* an excerpt range could cause the excerpt buffer rows to change, e.g. if
lines were added or removed. This manifested itself in a randomized test.
2022-05-18 10:13:18 +02:00
Keith Simmons
b03abdb6df
Reduce accessibility of multibuffer read to reduce risk of borrowing snapshot and buffer refcells twice
2022-05-13 16:58:30 -07:00
Keith Simmons
9bb347b513
Review fixes
2022-05-13 15:55:27 -07:00
Keith Simmons
07ccf7c74b
minor tweaks to selections collection api
2022-05-13 15:55:27 -07:00
Keith Simmons
c95f74648a
Rename selected_ranges and selected_display_ranges to remove redundant selected
2022-05-13 15:55:27 -07:00
Keith Simmons
2a984285a2
store buffer and display_map model handles on selections collection
2022-05-13 15:55:27 -07:00
Keith Simmons
851e04d46b
Passing tests and removed local argument. Also pulled autoscroll argument out to change_selections
2022-05-13 15:55:27 -07:00
Keith Simmons
9b46bb0ee6
Move selection helpers to SelectionCollection, add update_anchor_selections, add a number of invariant preserving mutation functions to the MutableSelectionCollection
2022-05-13 15:55:17 -07:00
Keith Simmons
5e768dbf57
Add test coverage for same cursor in multiple excerpts of the same buffer
2022-05-10 14:30:27 -07:00
Keith Simmons
1ba3b210c3
Fix multiple cursors inserting repeated text in multibuffers
2022-05-10 13:32:27 -07:00
Keith Simmons
81c44f9733
Merge pull request #968 from zed-industries/vim-visual-mode
...
Vim visual mode
2022-05-10 12:51:58 -07:00
Keith Simmons
cdbad9aee4
Initial visual mode
2022-05-10 11:12:28 -07:00
Antonio Scandurra
58367fccfb
WIP
2022-05-05 15:15:58 +02:00
Max Brunsfeld and Antonio Scandurra
c98d740d34
Improve the appearance of project panel filename editor
...
* Always layout single-line editors with a fixed height
* Preserve directory chevron when editing folder names
* Allow theming the filename editor
Co-authored-by: Antonio Scandurra <me@as-cii.com >
2022-05-04 10:28:44 -07:00
Max Brunsfeld
a95bc19817
Abstract more local project setup inside Project::test helper
2022-05-04 10:28:09 -07:00
Antonio Scandurra
1fba966284
Merge pull request #964 from zed-industries/transpose
...
Introduce `Editor::transpose` bound to `ctrl-t`
2022-05-04 10:04:55 +02:00
Antonio Scandurra
e28a1b05fb
Improve transpose when cursors are two chars away from each other
2022-05-04 09:59:34 +02:00
Antonio Scandurra
b0179e57c8
Account for multi-byte characters in Editor::transpose
2022-05-03 14:35:03 +02:00
Antonio Scandurra
9cdcdccd51
Add failing test for multi-byte characters
2022-05-03 14:33:57 +02:00
Antonio Scandurra
556763b301
Implement Editor::transpose without accounting for multi-byte chars
2022-05-03 14:33:43 +02:00
Keith Simmons
660e3e9ef2
Add insert line above and below
2022-05-02 11:49:10 -07:00
Keith Simmons
b011dbee8c
WIP just missing insert line above and below
2022-05-02 11:49:10 -07:00
Antonio Scandurra
d1d6e692fd
Use the new batched edit API when pasting
...
This fixes a bug that would cause zed to paste text at the wrong
location when inside a multi-buffer where the same buffer was excerpted
more than once.
2022-05-02 10:21:53 +02:00
Antonio Scandurra
e2b7ef1716
Insert newlines on paste if copied selections don't match current ones
2022-05-02 10:21:20 +02:00
Keith Simmons
94b6f4beb5
Merge pull request #929 from zed-industries/non-uniform-batched-edits
...
Allow batched edits where each range is associated with different insertion text
2022-04-29 16:14:38 -07:00
Keith Simmons
b2c1230fea
Convert common edit strings to Arc<str> and simplify duplicate line
2022-04-29 14:57:20 -07:00
4d5d50f32a
Reduce string allocations in Editor::insert
...
Co-authored-by: Nathan Sobo <nathan@zed.dev >
Co-authored-by: Keith Simmons <keith@zed.dev >
2022-04-29 10:07:21 -07:00
Keith Simmons
47d4f42467
Consolidate edit and edit_batched functions
2022-04-28 16:52:04 -07:00
Max Brunsfeld
538046d5dc
Add format_on_save setting
...
This lets you turn of formatting on save for specific languages.
2022-04-28 14:31:06 -07:00
Keith Simmons
c630ce81bb
tweak editor selection mutating functions
2022-04-28 13:46:06 -07:00