Commit Graph
391 Commits
Author SHA1 Message Date
Nathan Sobo 8ec2b5e359 Delete selected text when deleting to beginning of line 2022-04-22 06:04:14 -06:00
Antonio Scandurra 2695b13947 Always clear rename state when selections change
At some point during the implementation of rename, we added logic for
invalidating the rename state when the selection moved outside the original
rename range. After transitioning to displaying renames as a block decoration,
we don't need that anymore given that a new, temporary editor is used instead.

This commit removes that invalidation logic and always calls `Editor::take_rename`
when the editor selections change. Doing so also fixes a bug that was causing Zed
to hide the cursor when clicking on the editor to dismiss the rename.
2022-04-15 10:32:07 +02:00
Max Brunsfeld 3cdda79fc3 Merge pull request #817 from zed-industries/dynamic-editor-highlights
Store accessors for editor highlight colors not colors themselves
2022-04-14 10:36:38 -07:00
Keith Simmons 292d075f81 Store accessors for editor highlight colors not colors themselves 2022-04-13 15:30:57 -07:00
Keith Simmons b893cb6d82 rename NavigationData anchor and offset to cursor_anchor and cursor_offset 2022-04-13 14:53:47 -07:00
Keith Simmons 9cec6d8d65 add comment explaining offsets 2022-04-13 13:30:07 -07:00
Keith Simmons f20e3f35a1 Record scroll position in nav history 2022-04-13 12:30:33 -07:00
Max BrunsfeldandNathan Sobo 949fbe7cd3 Allow dumping the project diagnostic view's state as JSON
Also, improve DebugElements action so that it shows the JSON in an editor.

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-04-11 19:51:46 -07:00
Max Brunsfeld b3c64e47f1 Merge branch 'main' into cancel-buffer-search 2022-04-11 17:38:26 -07:00
Keith Simmons 4b295f566a Handle editor cancel in pane in order to dismiss find toolbar 2022-04-11 15:11:23 -07:00
Max Brunsfeld 3636c9ec25 Load workspace and editor key bindings from a JSON file 2022-04-10 11:18:08 -07:00
Max Brunsfeld fd4b81c8fc Allow actions to be deserialized from JSON
Introduce separate macro for implementing 'internal' actions which
are not intended to be loaded from keymaps.
2022-04-08 15:47:51 -07:00
c801a52492 Convert some actions to use named fields
Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-07 16:44:37 -07:00
5242a3a6dc Restructure action macro to assign a namespace to every action
Also, allow arbitrary types to be used as Actions via the impl_actions macro

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-07 16:20:49 -07:00
Max Brunsfeld ea63df0519 Don't activate the next pane when opening excerpts 2022-04-06 15:46:11 -07:00
Keith SimmonsandMax Brunsfeld 67b15ee037 Use language specific tabsize in editor commands
Co-authored-by: Max Brunsfeld <max@zed.dev>
2022-04-06 15:10:29 -07:00
Keith Simmons 1812480cbb Tab size is pulled properly from settings instead of hardcoded 2022-04-06 10:23:37 -07:00
Max BrunsfeldandKeith Simmons 866ffdd4ae Move Settings to its own crate
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-06 10:23:33 -07:00
Max BrunsfeldandKeith Simmons 664f17f92b Avoid maintaining indent size as state on buffers
Indent size is still hard-coded, but it's now controlled by the
editor and not the buffer.

Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-06 10:22:29 -07:00
Antonio Scandurra c62a3ea672 Merge pull request #687 from zed-industries/vim-word-and-line-movement
Add word and line movement in vim normal mode
2022-04-04 14:42:27 +02:00
Antonio Scandurra b0b54365c7 Re-render breadcrumbs when buffer has been reparsed 2022-04-02 16:33:24 +02:00
Max Brunsfeld ba009724dd Handle LSP apply workspace edit request fully before responding 2022-04-01 11:59:21 -07:00
Max Brunsfeld e987a8ba63 Let fake and real LanguageServer access AsyncAppContext in handler callbacks
Also, reimplement FakeLanguageServer by wrapping LanguageServer, instead of
duplicating its functionality differently.
2022-03-31 21:57:00 -07:00
Max Brunsfeld 4805cfe48c Merge branch 'main' into typescript 2022-03-30 14:44:07 -07:00
Max Brunsfeld ebc711f9f5 Restructure fake language server setup
Replace FakeLanguageServerConfig with FakeLanguageServerAdapter
2022-03-29 17:55:57 -07:00
Keith Simmons ec57c1f4ac Properly dedup restarts of language servers 2022-03-29 17:46:39 -07:00
Keith Simmons 6d91fd078c Add restart-lsp keybinding 2022-03-29 17:24:23 -07:00
Max Brunsfeld a8600e76a3 Make language's language server config non-optional 2022-03-28 18:14:49 -07:00
Antonio Scandurra f274a6ab4f Avoid unnecessary clones when undoing/redoing selections 2022-03-28 17:47:14 +02:00
Antonio Scandurra 5ef6337b09 Merge branch 'main' into selection-history 2022-03-28 17:24:46 +02:00
Antonio ScandurraandNathan Sobo aec82ef71e Test selection history
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-28 17:20:52 +02:00
Antonio Scandurra 686085dd60 Merge pull request #690 from zed-industries/indent-keybindings
Bind `Outdent` and `Indent` respectively to `cmd-[` and `cmd-]`
2022-03-28 16:50:23 +02:00
Antonio Scandurra bbfb63ff89 Cap selection history to 1024 entries 2022-03-28 16:37:48 +02:00
Antonio ScandurraandNathan Sobo 2a1fed1387 Insert tabs instead of indenting only when all selections are empty
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-28 16:36:12 +02:00
Antonio Scandurra 73c2f52158 Implement cmd-u and cmd-shift-u to undo and redo selections 2022-03-28 16:05:44 +02:00
Antonio Scandurra 4ed0607e1e Extract SelectionHistory in preparation to store an undo/redo stack 2022-03-28 14:52:54 +02:00
Antonio Scandurra 3cfa2c65b3 Autoscroll to newest cursor on cmd-d instead of fitting all selections 2022-03-28 14:38:51 +02:00
Antonio Scandurra ac88003c19 Bind Outdent and Indent respectively to cmd-[ and cmd-] 2022-03-28 11:34:46 +02:00
Antonio Scandurra a2c4205c5c Make indent and outdent explicit actions and unify tabbing logic 2022-03-28 11:34:38 +02:00
Antonio Scandurra 2c78c830eb Skip formatting during save if it takes too long 2022-03-28 11:02:20 +02:00
Antonio Scandurra cbd266052d Allow returning futures in fake language server request handlers 2022-03-28 10:44:32 +02:00
Keith Simmons a7a52ef3f7 Add word and line movement in vim normal mode
Add jump to start and end of the document
Move vim tests to relevant vim files
Rename VimTestAppContext to VimTestContext for brevity
Improve VimTestContext assertions to pretty print locations when selection position assertion panics
2022-03-27 17:58:28 -07:00
Nathan Sobo fe1f857e84 Merge pull request #684 from zed-industries/subword
Add bindings for subword movement and deletion
2022-03-26 07:18:29 -06:00
Nathan Sobo d4436277ee Merge pull request #682 from zed-industries/vim-hjkl
Vim hjkl
2022-03-26 07:11:46 -06:00
Nathan Sobo 2dc76a2b58 Add bindings for subword movement and deletion 2022-03-26 07:10:16 -06:00
Keith Simmons 1a29180185 Fixed issue with enabling and disabling vim mode dynamically
Also added indoc and marked text utility to vim tests to improve readability
2022-03-25 20:10:52 -07:00
Keith SimmonsandNathan Sobo 0aaf270650 Add clip_to_line_end to display_map/snapshot and set it to ensure vim positioning in normal mode
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-03-25 20:10:52 -07:00
Keith SimmonsandNathan Sobo bb9b36dccd Add initial vim mode mode switching
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-03-25 20:10:37 -07:00
Nathan Sobo 2c232d585a Merge branch 'main' into unfold-on-select-match 2022-03-24 14:13:27 -06:00
Nathan Sobo ccc276da7a Merge pull request #672 from zed-industries/fix-unfollowing-on-edit
Automatically unfollow leader only for edits that originate from the follower editor
2022-03-24 13:26:28 -06:00