Commit Graph
49 Commits
Author SHA1 Message Date
Antonio Scandurra 339069b1d3 Cap MessageStream buffer size to 1MB
We temporarily let it grow when the message size exceed the limit,
but restore the buffer's capacity shortly after. This ensures that,
for each connection in its entire lifetime, we only ever use 1MB.
2022-05-31 11:16:32 +02:00
Max BrunsfeldandKeith Simmons 42cd2ae142 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 d11bc2a4b7 Fixup paste locations 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 11569a869a in progress working on aborting operators on unhandled editor input 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 33940b5dd9 Add visual line mode operator tests 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 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 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 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 6c57fcf9be Merge pull request #968 from zed-industries/vim-visual-mode
Vim visual mode
2022-05-10 12:51:58 -07:00
Keith Simmons 3f1640a9a0 Fix up assertion errors in set_eq and visual tests 2022-05-10 11:12:34 -07:00
Keith Simmons 37c921f972 Initial visual mode 2022-05-10 11:12:28 -07:00
Antonio ScandurraandNathan Sobo 2e6cf2011d When opening items via project panel, only focus them on double-click
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-05-05 15:27:27 +02:00
Keith Simmons 797aecf7c1 Don't reset vim mode on editor focus 2022-05-02 11:49:10 -07: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
Keith Simmons 74b467aaa8 tweak editor selection mutating functions 2022-04-28 13:46:06 -07:00
Keith Simmons 5ea782de21 Add inclusive vs exclusive motions to vim mode 2022-04-21 16:50:23 -07:00
Max Brunsfeld 3a28f09979 Allow comments in setting and keymap JSON files 2022-04-21 11:58:18 -07:00
Keith Simmons 8ff0277103 Handle linewise motions correctly and fix panic when executing invalid actions 2022-04-19 11:36:44 -07:00
Keith Simmons dd25ab5798 Revert d/c j and k binding special casing 2022-04-18 14:44:11 -07:00
Keith Simmons 63278041e1 Add c and d operators to vim normal mode
Extracted motions from normal mode
Changed vim_submode to be vim_operator to enable better composition of operators
2022-04-15 16:05:50 -07:00
Max BrunsfeldandKeith Simmons ee3eb9658f Use the word 'keymap' more consistently
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-11 17:02:16 -07:00
Max BrunsfeldandKeith Simmons be11f63f1e Watch ~/.zed/bindings.json file for custom key bindings
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-11 16:50:44 -07:00
Max Brunsfeld 92a5c30389 Merge branch 'main' into load-keymaps 2022-04-11 15:55:10 -07:00
Max BrunsfeldandKeith Simmons c065f283aa Move assets to their own crate, load keymaps in vim tests
Also, move assets folder to the top-level.

Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-11 15:54:52 -07:00
Max Brunsfeld 9a4b8e3d8c Load all keybindings from JSON file 2022-04-10 14:29:45 -07:00
Nathan Sobo 17195e615e Merge pull request #781 from zed-industries/structured-logging
Introduce structured logging
2022-04-09 07:40:24 -06: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
Nathan SoboandAntonio Scandurra 7e5a3f9f6b Introduce structured logging
We're enabling the log crate feature everywhere, but only using it on the server for now.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-04-08 10:06:51 -06: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 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
Antonio ScandurraandNathan Sobo 328be473e5 Rename sub_mode to submode
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-04-04 14:14:21 +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 c6ad667d49 Assign normal mode when re-enabling 2022-03-26 19:19:12 -06:00
Nathan Sobo daf999c3be Fully disable vim mode on start unless it's enabled
Also: Make some structural adjustments to remove the need for defer. Instead of accessing the global in associated VimState functions, have a single method that allows us to call update instance methods.
2022-03-26 19:19:12 -06:00
Nathan Sobo 30e31f6561 Test that vim mode can be disabled on startup 2022-03-26 19:19:12 -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