Commit Graph

841 Commits

Author SHA1 Message Date
Keith Simmons
d11bc2a4b7 Fixup paste locations 2022-05-26 17:02:05 -07:00
Keith Simmons
e104cb94e7 fix bug in marked_range utils 2022-05-26 17:02:05 -07:00
Keith Simmons
98f9575653 WIP 2022-05-26 17:02:05 -07:00
Keith Simmons
e93c49f4f0 Unify visual line_mode and non line_mode operators 2022-05-26 17:02:05 -07:00
Keith Simmons
61f0daa5c5 Visual line mode handles soft wraps 2022-05-26 17:02:05 -07:00
Keith Simmons
082036161f Enable copy and paste in vim mode 2022-05-26 17:02:05 -07:00
Keith Simmons
d094d1d891 WIP copy on delete 2022-05-26 17:02:05 -07:00
Keith Simmons
f8f316cc64 Working change and delete in line mode 2022-05-26 17:02:05 -07:00
Keith Simmons
d7d17b2148 WIP line mode operations 2022-05-26 17:02:05 -07:00
Max Brunsfeld
acf9a59cc2
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
0becbe482a 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
fbd589b589 Start work on handling multibuffers properly when closing unsaved buffers 2022-05-22 16:48:33 -07:00
Antonio Scandurra
37ca06df53 Clear multi-buffer redo stack when pushing transaction onto undo stack 2022-05-22 10:44:32 +02:00
Max Brunsfeld
e72f5cea22 Add "New Window" command 2022-05-20 11:01:20 -07:00
Max Brunsfeld
c4fc3d9c7f
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
ef0b584532 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
bacfed37b7 Clone selections on editor split 2022-05-19 11:22:53 -07:00
Antonio Scandurra
c0bf4a5bfd 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
a2fd41174f 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
45ea3d4c38 Review fixes 2022-05-13 15:55:27 -07:00
Keith Simmons
20c97637a4 minor tweaks to selections collection api 2022-05-13 15:55:27 -07:00
Keith Simmons
c3a36e6d8a Rename selected_ranges and selected_display_ranges to remove redundant selected 2022-05-13 15:55:27 -07:00
Keith Simmons
de9dc27980 store buffer and display_map model handles on selections collection 2022-05-13 15:55:27 -07:00
Keith Simmons
db0a9114c2 Passing tests and removed local argument. Also pulled autoscroll argument out to change_selections 2022-05-13 15:55:27 -07:00
Keith Simmons
c9dcfff607 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
c4738d7316 Add test coverage for same cursor in multiple excerpts of the same buffer 2022-05-10 14:30:27 -07:00
Keith Simmons
68de51ba8a Fix multiple cursors inserting repeated text in multibuffers 2022-05-10 13:32:27 -07:00
Keith Simmons
6c57fcf9be
Merge pull request #968 from zed-industries/vim-visual-mode
Vim visual mode
2022-05-10 12:51:58 -07:00
Keith Simmons
37c921f972 Initial visual mode 2022-05-10 11:12:28 -07:00
Antonio Scandurra
61346f734d WIP 2022-05-05 15:15:58 +02:00
Max Brunsfeld
8fdc5c9be3 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
d4492086b3 Abstract more local project setup inside Project::test helper 2022-05-04 10:28:09 -07:00
Antonio Scandurra
aa4919a76f
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
9a7c07f539 Improve transpose when cursors are two chars away from each other 2022-05-04 09:59:34 +02:00
Antonio Scandurra
95680aa5f2 Account for multi-byte characters in Editor::transpose 2022-05-03 14:35:03 +02:00
Antonio Scandurra
b6ff07afac Add failing test for multi-byte characters 2022-05-03 14:33:57 +02:00
Antonio Scandurra
070607c821 Implement Editor::transpose without accounting for multi-byte chars 2022-05-03 14:33:43 +02:00
Keith Simmons
b2138f5935 Add insert line above and below 2022-05-02 11:49:10 -07:00
Keith Simmons
833a7b6e76 WIP just missing insert line above and below 2022-05-02 11:49:10 -07:00
Antonio Scandurra
2977b33dd9 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
5821ce9b82 Insert newlines on paste if copied selections don't match current ones 2022-05-02 10:21:20 +02:00
Keith Simmons
d4bef67cf2
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
2eb1c107ce Convert common edit strings to Arc<str> and simplify duplicate line 2022-04-29 14:57:20 -07:00
Max Brunsfeld
2c2ca1bfbd 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
b4b61b4bbc Consolidate edit and edit_batched functions 2022-04-28 16:52:04 -07:00
Max Brunsfeld
fa358c01cf 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
74b467aaa8 tweak editor selection mutating functions 2022-04-28 13:46:06 -07:00
Keith Simmons
42b900774e add anchor to selection fixup info in newline 2022-04-28 13:10:31 -07:00
Max Brunsfeld
37a3cead03
Merge pull request #921 from zed-industries/new-status-bar-design
Style the status bar according to the latest design
2022-04-28 12:42:25 -07:00
Antonio Scandurra
0bb889afec
Merge pull request #923 from zed-industries/navigate-panic
Clip `scroll_top_row` before navigating back to it
2022-04-28 10:22:09 +02:00