Commit Graph
1718 Commits
Author SHA1 Message Date
Max Brunsfeld 81a85e9c79 Extract a language crate 2021-10-20 22:51:40 +02:00
Max Brunsfeld cdb268e656 Re-enable randomized concurrent edits test 2021-10-20 21:44:26 +02:00
30e2e2014d Extract a TextBuffer from Buffer, which has no tree or file
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-20 00:10:57 +02:00
Nathan Sobo 76774d6a3c Merge pull request #205 from zed-industries/autoindent
Autoindent
2021-10-19 14:23:04 +02:00
5558d553bb Insert an extra newline between brackets
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-10-19 13:17:16 +02:00
Nate Butler 2286a94185 Make light collab cursor not yellow for Nathan ;) 2021-10-17 18:28:05 +02:00
Nathan Sobo 561857fdf2 Restore all active selections when undoing/redoing autoindent
In the unlikely event that we're handling autoindent requests from multiple editors, we undo/redo selections from both editors. This is somewhat imperfect but probably good enough and easier than performing auto-indents on a per-editor basis.
2021-10-11 17:22:18 -06:00
Max Brunsfeld 47372e7342 Move selections explicitly when applying autoindents 2021-10-11 15:27:38 -07:00
Max Brunsfeld 63e775eb4c Add unit tests for selective indentation adjustment 2021-10-11 13:02:01 -07:00
Max Brunsfeld 6dc9d3ac19 Move buffer tests into their own file 2021-10-11 12:18:31 -07:00
Max BrunsfeldandNathan Sobo 53f1078119 Ensure that autoindent task yields frequently to respect cancellation
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-11 11:25:15 -07:00
Antonio ScandurraandNathan Sobo 28ffd750ce WIP: Determine autoindents asynchronously
We still need to insert yield points in `compute_autoindents`.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-11 18:00:48 +02:00
Antonio Scandurra 7f5d454b2d Fix creation of anchors for the inserted portion of an edit 2021-10-11 13:08:50 +02:00
Antonio Scandurra b43c78053b Always use seek_forward when resolving anchors 2021-10-11 09:37:21 +02:00
Nathan Sobo 6531df2368 Improve auto-indenting of inserted lines
Still not working totally correctly with our new approach, but getting closer.
2021-10-08 22:07:01 -06:00
Max BrunsfeldandNathan Sobo e78a5642fa Start on new way of comparing old and new indent suggestions
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-08 16:54:27 -07:00
Nathan SoboandAntonio Scandurra b85ae89b7e Extend Rust where clauses past their final newline for indentation
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-10-08 10:32:15 -06:00
Nathan SoboandAntonio Scandurra 810315e04c Don't request auto-indent if there is no language assigned on the buffer
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-10-08 10:25:16 -06:00
Nathan SoboandAntonio Scandurra b4680144c5 Unconditionally preserve indentation when inserting newlines
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-10-08 10:25:00 -06:00
Antonio ScandurraandNathan Sobo c60bc00c9e 💄
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-08 17:43:19 +02:00
Antonio Scandurra f66b52239e Cancel out outdents and indents referring to the previous row 2021-10-08 12:52:48 +02:00
Antonio Scandurra 18e5d75fd3 Bias the start of an autoindent request towards the right for new text
When a newline is inserted, this prevents the request from including
the line on which the newline got inserted.
2021-10-08 12:15:21 +02:00
Max Brunsfeld 451f0e7adb Replace Buffer::request_autoindent API with ::edit_with_autoindent
When computing the "previous autoindent suggestion", we can't just
use the old tree and the current text. We need to find out what the
suggestion would have been before we made any changes.
2021-10-07 17:55:23 -07:00
Max BrunsfeldandNathan Sobo c0a75abcd2 Preserve indentation for lines that are both indented and outdented
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-07 13:55:59 -07:00
Max Brunsfeld d77025540a Remove no-longer-used dirty field on buffer::SyntaxTree
This became unnecessary when we reworked our reparsing logic
to block from 1ms on each parse.
2021-10-07 12:46:08 -07:00
Max Brunsfeld b5d3ffb16c Fix collection of row ranges in Buffer::perform_autoindent 2021-10-07 12:43:26 -07:00
Max BrunsfeldandAntonio Scandurra 2f295382c4 Implement selective auto-indent by comparing old and new suggestions
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-10-07 10:46:40 -07:00
Antonio ScandurraandMax Brunsfeld 54932a8050 WIP
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-10-07 19:09:14 +02:00
Antonio ScandurraandNathan Sobo 2018537bb8 Introduce a Tab action to indent line or insert soft tabs
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-07 17:31:58 +02:00
Antonio ScandurraandNathan Sobo d36805c464 Don't push empty transactions onto the undo stack
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-07 16:06:55 +02:00
Max Brunsfeld 77af9ef902 Add more rust indent nodes 2021-10-06 22:16:30 -07:00
Max Brunsfeld add1467d32 Generalize strategy for processing indentation ranges
* Take into account the ranges' start and end columns, not just the rows
* Generalize the approach to dedenting
2021-10-06 22:16:18 -07:00
Max BrunsfeldandNathan Sobo b83b4ad7c7 Start work on a Buffer API for requesting autoindent on the next parse
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-06 16:09:30 -07:00
Max Brunsfeld a0c8b60a1b Merge pull request #203 from zed-industries/autoclose-pairs
Autoclose pairs
2021-10-06 11:17:41 -07:00
724272931a Skip autoclosed pairs
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-10-06 19:04:55 +02:00
Antonio ScandurraandNathan Sobo 05d7e9c4e7 Start on autoclosing pairs
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-06 16:34:57 +02:00
Max Brunsfeld 3cb7ba0f57 Make the fields of buffer::Language private 2021-10-05 14:19:33 -07:00
Max Brunsfeld 0282e6f255 Add Cargo.toml features to fix compilation of individual crates 2021-10-05 14:18:04 -07:00
Max Brunsfeld cefb90269e Merge pull request #202 from zed-industries/crates
Break project into crates to improve incremental compilation time
2021-10-05 10:54:15 -07:00
Max Brunsfeld 2fcb90652b Fix path to zed crate in script/bundle 2021-10-05 10:46:59 -07:00
f70e3878b6 Flip the dependency between editor and theme
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-10-05 19:21:13 +02:00
Antonio Scandurra f09798c4a7 Use the same test::run_test function for async gpui::tests 2021-10-05 18:04:22 +02:00
Antonio ScandurraandNathan Sobo 9c7ef39da6 Minimize code generation for synchronous gpui::test macro
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-05 17:47:46 +02:00
Antonio Scandurra 7a05461c50 Avoid loading Rust grammar in zed tests 2021-10-05 15:43:57 +02:00
Antonio Scandurra 2280c75103 Extract theme_selector into its own crate 2021-10-05 15:38:25 +02:00
Antonio Scandurra 47b29a5f21 Extract people_panel into its own crate 2021-10-05 14:36:38 +02:00
Antonio Scandurra cd6378e848 Extract file_finder into its own crate 2021-10-05 14:30:56 +02:00
Antonio Scandurra 1ec0afb2d1 Extract chat_panel into its own crate 2021-10-05 14:23:45 +02:00
Antonio Scandurra d04a11405c Extract project_panel into its own crate 2021-10-05 14:19:57 +02:00
Antonio Scandurra 499616d769 Move workspace module into its own crate 2021-10-05 13:49:10 +02:00