Commit graph

764 commits

Author SHA1 Message Date
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
Max Brunsfeld
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
Max Brunsfeld
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
Antonio Scandurra
73f2fd6b09 Pass visible bounds to Element::dispatch_event 2022-04-07 15:10:09 +02:00
Antonio Scandurra
52251c3463
Merge pull request #745 from zed-industries/scroll-tabs
Allow pane tabs to be scrolled when they overflow
2022-04-07 09:48:54 +02:00
Max Brunsfeld
ec837fa6d7 Update breadcrumbs when multibuffers' excerpts change 2022-04-06 17:12:36 -07:00
Max Brunsfeld
ea63df0519 Don't activate the next pane when opening excerpts 2022-04-06 15:46:11 -07:00
Keith Simmons
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 Brunsfeld
866ffdd4ae Move Settings to its own crate
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-06 10:23:33 -07:00
Max Brunsfeld
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
Nathan Sobo
eb99588368 Remove stray dbg! expressions 2022-04-05 20:02:45 -06:00
Keith Simmons
05a05157fa Move style source files to src and build to dist
Co-authored-by: Nate Butler <nate@zed.dev>
2022-04-04 14:43:13 -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
Antonio Scandurra
c39de1f9dc Show full path for file worktrees or when there is more than 1 worktree 2022-04-02 16:10:10 +02:00
Max Brunsfeld
fe27a27cb6 Merge branch 'main' into prompt-on-close 2022-04-01 15:29:23 -07:00
Max Brunsfeld
79bd8642e6
Merge pull request #702 from zed-industries/typescript
Add support for JS/Typescript/TSX, allow language servers to support multiple languages
2022-04-01 15:24:58 -07:00
Max Brunsfeld
ba009724dd Handle LSP apply workspace edit request fully before responding 2022-04-01 11:59:21 -07:00
Antonio Scandurra
703f1c3be0 Introduce workspace::Item::reload to manually trigger a reload 2022-04-01 14:02:49 +02:00
Antonio Scandurra
bdd95a82d7
Merge pull request #705 from zed-industries/breadcrumbs
Introduce breadcrumbs
2022-04-01 11:02:54 +02: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
Antonio Scandurra
099250c691 Introduce MultiBuffer::symbols_containing 2022-03-29 15:08:37 +02: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 Scandurra
aec82ef71e Test selection history
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-28 17:20:52 +02:00
Antonio Scandurra
45ecd8e0a6 Always use square brackets in marked_text_ranges
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-28 17:11:35 +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 Scandurra
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 Simmons
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 Simmons
bb9b36dccd Add initial vim mode mode switching
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-03-25 20:10:37 -07:00