Commit Graph
63 Commits
Author SHA1 Message Date
Max Brunsfeld 6cdf4e98fc Re-export basic text types from text and language crates
Also avoid production dependencies on fs and rope in collab
2022-10-12 15:48:19 -07:00
Mikayla Maki 0beb97547e Finished refactoring out fs and rope 2022-10-11 15:25:54 -07:00
ForLoveOfCatsandMikayla 8ba2f77148 One big cleanup pass of clippy lints
Co-authored-by: Mikayla <mikayla@zed.dev>
2022-08-10 16:51:01 -07:00
Antonio Scandurra 1e94eb74f4 Don't ignore new tab snapshot in WrapMap if only tab size changed 2022-08-03 12:16:46 +02:00
Keith Simmons 755636d10e Use NonZeroU32 to ensure settings tabsize cannot be zero 2022-06-23 12:55:38 -07:00
Keith Simmons 1da1853a76 Hide hover when font changes, and handle case where delay was preventing hover with large symbol range 2022-06-09 17:03:44 -07:00
Antonio Scandurra 6d33697e82 Fix warning 2022-04-14 13:03:46 +02:00
Antonio Scandurra 1a1d670104 Speed up WrapSnapshot::line_len using the indexed transforms 2022-04-14 13:01:29 +02: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
Nathan Sobo e6b1fea117 WIP 2022-03-10 11:32:14 -07:00
Antonio Scandurra 466db69780 Pass a reference to TestAppContext in tests
This allows us to drop the context *after* we ran all futures to
completion and that's crucial otherwise we'll never drop entities
and/or flush effects.
2022-03-01 12:01:02 +01:00
Max Brunsfeld 1ee15e1a59 Add and remove excerpts in randomized FoldMap and WrapMap tests 2022-02-09 14:43:24 -08:00
Max Brunsfeld 3d9c39d0eb Silence warnings 2022-02-09 13:00:09 -08:00
fc70c6d4fd Fix BlockMap's handling of trailing empty excerpt updates with other edits
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-09 11:54:59 -08:00
fab6f0c568 Add/remove excerpts in BlockMap randomized tests and fix resulting errors
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-02-09 19:10:13 +01:00
Antonio ScandurraandNathan Sobo 8d95dbe3e6 Render path headers in editor element
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-09 16:28:18 +01:00
Antonio Scandurra ab26a175a4 Opt into language-aware features when getting buffer chunks
We use chunks a lot to transform points and sync the various display maps,
and always querying tree-sitter or the LSP diagnostics in those cases is
unnecessarily expensive.
2022-02-03 11:21:30 +01:00
Max Brunsfeld 88adddb324 Remove theme parameters from buffer/display map's chunks methods
Change Chunks to contain highlight ids instead of actual highlight
styles. Retrieve the actual highlight style from the theme in the
editor element layer.

This is to set us up to perform syntax highlighting in other code
paths where the theme is not available.
2022-02-02 16:33:04 -08:00
Nathan SoboandAntonio Scandurra d7a78e14ac Allow disk-based diagnostic progress begin/end events to interleave
When multiple saves occur, we can have multiple start events followed by multiple end events. We don't want to update our project diagnostics view until all pending progress is finished.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-01-06 09:32:08 -07:00
Nathan Sobo 7f786ca8a6 WIP: Start moving toward a simpler interface for detecting prev/next line boundaries 2021-12-27 22:11:05 -08:00
Max Brunsfeld 6444fcd442 Integrate MultiBuffer::buffer_rows into the display map 2021-12-16 13:53:32 -08:00
Antonio Scandurra 0fc2db6d6e Account for folds when inserting/removing block decorations 2021-12-16 16:44:15 +01:00
Antonio Scandurra ec39c9d335 Allow specifying MAX_EXCERPTS via an env variable in random tests 2021-12-16 12:28:54 +01:00
Max BrunsfeldandNathan Sobo 3e2f684545 Fix prev_row_boundary when a wrap follows a fold
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-15 18:30:09 -08:00
80abd84050 Create MultiBuffers with more than one fragment in more randomized tests
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-12-15 18:38:37 +01:00
Nathan Sobo c8b43e3078 Move multi_buffer to editor crate 2021-12-10 17:37:53 -07: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
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
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
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 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
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 Brunsfeld 8d1a4a6a24 Start work on allowing blocks to be styled 2021-11-18 18:16:35 -08:00
bef09696f6 Align block text with the anchor's column
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-18 12:17:22 -08:00
Antonio ScandurraandNathan Sobo 0a6293bcda Support highlighting in blocks
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-18 14:08:21 +01:00
Antonio Scandurra 856768a43c Remove aggressive logging from WrapMap update code paths 2021-11-18 11:13:40 +01:00
Antonio Scandurra 08e0444ee4 Use char count instead of byte count to determine longest row 2021-11-18 11:01:12 +01:00
Antonio Scandurra 572e571927 Test longest row only when tabs are not present or the tab size is 1
This is because the longest row calculation is best-effort at the moment,
since this information is not indexed in the `TabMap`.
2021-11-18 10:54:22 +01:00
Nathan SoboandMax Brunsfeld 213aa36e1c WIP: Track down bugs with longest_row on wrap map
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-11-17 19:45:56 -07:00
Nathan SoboandMax Brunsfeld c5956a0363 Start at the end of the last transform when catching up to edits during wrapping
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-11-17 19:44:17 -07:00
Max BrunsfeldandNathan Sobo 707ffe8ff3 Implement BlockSnapshot::line_len, use it in DisplayMap
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-17 14:56:05 -08:00
198f6694b7 Use options to represent soft-wrapped buffer rows
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-11-17 19:30:40 +01:00
Nathan SoboandMax Brunsfeld 52a4c15c14 Eliminate non-highlighted chunks APIs
Now we only have a single code path for chunks across all layers, but highlighting is optional and controlled by a flag.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-11-16 16:51:38 -08:00
Nathan SoboandMax Brunsfeld 862b988d56 Position blocks above/below buffer lines, even when the anchored line is soft-wrapped
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-11-15 16:45:51 -07:00
Nathan Sobo e644c0876e WIP: Start moving BlockMap to a 2d indexing scheme 2021-11-14 08:29:41 -07:00