Commit Graph
224 Commits
Author SHA1 Message Date
Antonio Scandurra 2d1ff8f606 Clip anchors created on MultiBuffer's trailing newlines or headers 2021-12-14 12:29:05 +01:00
Antonio Scandurra 1b67f19edc Implement MultiBuffer::set_active_selections 2021-12-14 12:13:19 +01:00
Antonio Scandurra 163ce95171 Implement MultiBufferSnapshot::remote_selections_in_range 2021-12-14 11:34:26 +01:00
Antonio Scandurra 174b37cdf0 Assume all excerpts in the multi buffer have the same language for now 2021-12-14 11:33:53 +01:00
Antonio Scandurra 04ffca95c6 Keep a separate diagnostic update count and parse count in MultiBuffer 2021-12-14 11:32:49 +01:00
Max Brunsfeld 4efdc53d9f WIP 2021-12-13 17:44:20 -08:00
Max BrunsfeldandNathan Sobo 52b8e3d1a2 Get tests passing after diagnostic + selection changes
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-13 11:34:56 -08:00
Antonio ScandurraandNathan Sobo 85674ba506 WIP
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-13 16:46:35 +01:00
Antonio ScandurraandNathan Sobo 6645e2820c First attempt at implementing MultiBuffer::edit_internal
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-13 15:43:26 +01:00
Antonio Scandurra c984b39aaa Show remote collaborators' active selections 2021-12-13 11:38:38 +01:00
Nathan Sobo cdbcbdfe6d Test undo/redo at editor layer, including selection restoration 2021-12-12 15:04:19 -07:00
Nathan Sobo 44cd0be068 Restore selections upon undo/redo of edits performed in the current editor 2021-12-12 14:12:03 -07:00
Nathan Sobo 1e7184ea07 Get selections rendering again when local selections are owned by Editor 2021-12-11 13:42:46 -07:00
Nathan Sobo 4dd0752e80 More messy progress towards selections in editors 2021-12-11 00:29:34 -07:00
Nathan Sobo f5c775fcd1 WIP 2021-12-10 22:16:39 -07:00
Nathan Sobo 8432daef6a WIP: Start on removing selections from buffer in favor of editor 2021-12-10 19:23:34 -07:00
Nathan Sobo f35c419f43 Return optional transaction ids from undo/redo
This will allow the editor to restore selections that it associated with the start or end of a transaction.
2021-12-10 18:08:26 -07:00
Nathan Sobo 77defe6e28 Return optional transaction ids when starting/ending a transaction
If the transaction was nested, we return None. Otherwise we return the transaction id in preparation for editors to maintain their own selection state.
2021-12-10 18:00:09 -07:00
Nathan Sobo c8b43e3078 Move multi_buffer to editor crate 2021-12-10 17:37:53 -07:00
Max BrunsfeldandNathan Sobo 6caf016df9 Get tests passing w/ multibuffer in editor
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-10 15:54:25 -08:00
Max Brunsfeld a758bd4f8d Fill in some missing methods on MultiBuffer, MultiBufferSnapshot 2021-12-10 14:27:04 -08:00
Antonio ScandurraandNathan Sobo 5b31c1ba4e Start making MultiBuffer work with a singleton buffer
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-10 18:04:11 +01:00
Antonio ScandurraandNathan Sobo 7524974f19 Get everything compiling again
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-10 17:15:16 +01:00
Antonio ScandurraandNathan Sobo da09247e5e WIP
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-10 16:14:12 +01:00
Max Brunsfeld 5e516f59c0 Merge branch 'fragment-locators' into HEAD 2021-12-09 14:49:04 -08:00
Antonio ScandurraandNathan Sobo 91a7bbbba2 Fix some of the diagnostic tests and make DiagnosticEntry generic
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-09 17:53:08 +01:00
Antonio ScandurraandNathan Sobo 65711b2256 Remove anchor collections
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-09 17:28:27 +01:00
Nathan Sobo 4ee404a0af Take a cx in MultiBuffer::start_transaction 2021-12-08 19:30:52 -07:00
Nathan SoboandMax Brunsfeld 87d16c271e Get Editor compiling with MultiBuffer as its buffer
There's a bunch of unimplemented methods in MultiBuffer, but everything compiles.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-08 19:23:04 -07:00
5f8e406c18 Fill out ExcerptList API
This restores the improvements that we had made on the `project-diagnostics-generic` branch.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-08 10:04:22 -08:00
Antonio Scandurra a88cff4fa0 Remove lifetime parameter from TextDimension trait
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-12-08 09:45:57 -08:00
Max Brunsfeld 6a44a7448e Consolidate Edit types in editor crate 2021-12-08 09:33:55 -08:00
Max Brunsfeld fa379885f1 Give more specific names to all snapshot and text iterator types 2021-12-08 09:24:00 -08:00
Antonio Scandurra 8f90d42723 Merge branch 'main' into project-diagnostics 2021-12-06 09:39:03 +01:00
Max Brunsfeld 026c3476db Upgrade tree-sitter to 0.20.1 2021-12-05 21:37:08 -08:00
Nathan Sobo 811696670a Start on a new FragmentList
Here I'm exploring a new approach to the project-wide diagnostics view that can exactly mirror the contents of cargo check. The `FragmentList` composes an arbitrary list of fragments from other buffers and presents them as if they were a single buffer.
2021-12-04 06:57:56 -07:00
Nathan SoboandMax Brunsfeld 5ae46709b0 Fix alignment of blocks adjacent to other blocks
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-01 17:58:44 -07:00
Nathan SoboandMax Brunsfeld ee693a8d2b Get all tests passing with new blocks API
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-01 17:52:34 -07:00
Nathan SoboandMax Brunsfeld 512a10b037 Use new BlockMap API to render diagnostics
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-01 17:22:40 -07:00
Max BrunsfeldandNathan Sobo 0c714210ff Start work on generalizing the BlockMap to allow arbitrary elements
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-01 15:25:55 -08:00
Antonio ScandurraandNathan Sobo 733e0cb21b Use the new buffer subscription API to keep DisplayMap in sync
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-01 16:08:53 +01:00
Antonio ScandurraandNathan Sobo 3b536f153f Introduce text::Buffer::subscribe
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-01 15:55:05 +01:00
Antonio Scandurra 47c467dafc Bump FoldMap's version in FoldMap::sync (and not in DisplayMap) 2021-12-01 12:05:02 +01:00
Max BrunsfeldandNathan Sobo faba276fdc WIP - maintain foldmap with Buffer::edits_since
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-30 17:23:02 -08:00
Max Brunsfeld 924e1578ea Use &Snapshot directly instead of impl Into<Content<'a>>
The text::Buffer and its snapshot already used the same representation
for their content, so we can just make Buffer deref to a Snapshot.
2021-11-30 13:32:11 -08:00
Nathan SoboandMax Brunsfeld 1445ce10b5 Name the root file of every crate after the crate to ease navigation
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-11-30 12:46:39 -07:00
Nathan SoboandMax Brunsfeld d3f28166cb Rename buffer crate to text and name its entrypoint after the crate
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-11-30 12:26:12 -07:00
Nathan SoboandAntonio Scandurra 0ed488d93b Avoid building up pending edits when soft wrapping is disabled
This was causing us to get slower over time as we stacked up hundreds of thousands of pending edits whenever soft wrap was disabled.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-11-30 08:28:29 -07:00
Max BrunsfeldandNathan Sobo 4cc1556ca4 Introduce weak_handle methods on ModelContext and ViewContext
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-29 14:13:22 -08:00
Antonio Scandurra 9d7039ed51 Embed a plain text grammar and override settings for that too 2021-11-29 18:01:51 +01:00