Commit Graph
92 Commits
Author SHA1 Message Date
Nathan Sobo da50576129 Fix remaining errors and warnings 2021-07-25 07:56:53 -06:00
Nathan Sobo 9edc8b9a06 WIP 2021-07-24 08:40:48 -06:00
Antonio Scandurra 80f13dd737 WIP 2021-07-22 18:31:01 +02:00
Max BrunsfeldandNathan Sobo 72fdd3fb9a Start rendering highlighted text and line numbers via the wrap map
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-20 18:03:02 -07:00
Max Brunsfeld d0fdc7b5e8 Get simple unit test passing for soft-wrap in DisplayMap 2021-07-20 15:22:11 -07:00
Max BrunsfeldandNathan Sobo 7832562675 Add WrapMap as a member of DisplayMap
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-20 13:03:59 -07:00
Max BrunsfeldandNathan Sobo dbc8fc3bfa Fix assertions in fold map test
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-20 11:43:10 -07:00
Max BrunsfeldandNathan Sobo f9e13f3429 Start work on WrapMap::chunks_at
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-19 16:23:56 -07:00
Nathan Sobo e193a660aa WIP 2021-07-19 13:59:07 -06:00
Antonio ScandurraandNathan Sobo 631a6a2f45 Re-enable wrap_map module and fix compile errors
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-19 18:40:57 +02:00
Antonio ScandurraandNathan Sobo 359132ac19 Extract tab expansion logic into TabMap
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-19 17:29:03 +02:00
Antonio ScandurraandNathan Sobo 5a0d156cc5 Clarify input and output coordinates in display_map
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-19 16:18:20 +02:00
Antonio Scandurra 9e448e694d Add fold_map::Snapshot::text_summary_for_range 2021-07-19 12:25:27 +02:00
Antonio Scandurra 7a86a2c831 Change fold_map::Edit to return DisplayOffsets
This is needed so that we can translate display offsets into display
points in the `WrapMap`.
2021-07-19 11:34:47 +02:00
Antonio Scandurra 8d3c3d7c46 Work on a randomized test for edits/snapshots returned by FoldMap
...and make it pass too!
2021-07-16 15:48:43 +02:00
Antonio Scandurra 831b620e51 Make writing/reading FoldMap explicit so that we can retrieve edits 2021-07-16 13:49:38 +02:00
Antonio Scandurra 23b55d88d9 Pull snapshot history out of fold map 2021-07-16 13:49:02 +02:00
Max Brunsfeld e0930ddc09 Add FoldMapSnapshot::edits_since_creation 2021-07-15 18:27:59 -07:00
Nathan SoboandMax Brunsfeld 8b34deab58 Try to return edits from FoldMap::apply_edits
The goal is to describe how the fold map changed. Hopefully this is correct.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-15 15:08:18 -06:00
Nathan SoboandMax Brunsfeld 2c9f730638 Give the FoldMap its own edit type that does not have deleted_lines
We want to use this struct to communicate about edits performed to the fold map itself, and it will be simpler if we don't have to communicate this data.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-15 14:19:58 -06:00
Nathan SoboandMax Brunsfeld 2bde54971e Move all FoldMap query methods to FoldMapSnapshot
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-15 11:36:24 -06:00
Antonio Scandurra be954872d0 Calculate an old_lines range in Edits iterator 2021-07-15 10:11:24 +02:00
Antonio Scandurra a5edc14e3a WIP: Start on WrapMap 2021-07-14 18:43:48 +02:00
Antonio Scandurra e80439daaa Merge branch 'main' into rpc 2021-06-29 10:25:42 +02:00
Max Brunsfeld 60ee97be24 Always represent anchor as a versioned offset
Remove the `Start` and `End` variants, and always
use the structure that was previously called `Middle`.
This makes Anchors simpler to serialize and deserialize.
2021-06-25 17:02:48 -07:00
Max Brunsfeld 04c80578bc Start work on sending buffer operations 2021-06-25 13:46:36 -07:00
Nathan SoboandMax Brunsfeld a364839e93 Replace FileHandle with File entity that subscribes to Worktree update events
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-06-21 20:40:40 -06:00
Antonio Scandurra 742241a903 Rename Cursor::{start,end} to Cursor::{sum_start,sum_end} 2021-06-10 14:06:27 +02:00
Antonio Scandurra dc2805bb14 Add Cursor::seek_end and audit the codebase to use seek_start more 2021-06-10 14:05:56 +02:00
Antonio Scandurra e071d40058 Use a single Bias enum everywhere 2021-06-04 13:39:57 +02:00
Antonio Scandurra 311e1b0f5e Supply a context when adding summary to Dimension 2021-06-01 12:50:10 +02:00
Antonio Scandurra e8a9eee84f WIP 2021-05-31 16:57:15 +02:00
Max Brunsfeld 16c6400145 Rename context parameters to cx in fold_map.rs 2021-05-28 15:08:38 -07:00
Antonio Scandurra 23d1d91414 Implement select_larger_syntax_node for buffer 2021-05-28 13:25:09 +02:00
Max BrunsfeldandNathan Sobo 5d2ac3f4e4 Use new Tree-sitter captures API
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-05-25 16:02:43 -07:00
Antonio Scandurra 2e7593dd79 💄 2021-05-25 14:20:53 +02:00
Antonio Scandurra aeb68867da Move highlighted_text_in_range from Buffer to buffer::Snapshot 2021-05-25 11:51:29 +02:00
Max Brunsfeld 8340958b33 Convert query capture indices to style ids
* Introduce a Theme struct as a new part of the app's settings
* Store on each Language a ThemeMap, which converts the capture ids
  from that language's highlight query into StyleIds, which identify
  styles in the current Theme.
* Update `highlighted_chunks` methods to provide StyleIds instead of
  capture ids.
2021-05-24 16:44:14 -07:00
Antonio Scandurra d063ebdf9b Correctly store current chunk offset in fold_map::HighlightedChunks 2021-05-24 16:52:01 +02:00
Antonio Scandurra 4ddf10967e Introduce fold_map::HighlightedChunks 2021-05-24 15:39:22 +02:00
Antonio Scandurra 4ada5e0666 Rename rope::ChunksIter to rope::Chunks
This is consistent with how we name the other chunk iterators.
2021-05-24 15:05:11 +02:00
Antonio Scandurra 3a576f0b65 Don't clone visible_text for splicing edits into the parse tree 2021-05-22 12:34:35 +02:00
Max Brunsfeld 46e6b2cff4 Start maintaining a syntax tree on buffers 2021-05-22 12:34:35 +02:00
Antonio ScandurraandNathan Sobo b42f5142f7 Rename rightmost_{row,chars} to longest_{row,chars}
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-05-20 16:32:09 +02:00
Antonio Scandurra 6a0757ebf9 Don't store rightmost row/char-column as a Point 2021-05-20 12:52:58 +02:00
Antonio Scandurra ed57ffe5fa Replace rightmost_point with righmost_row 2021-05-20 12:47:08 +02:00
Antonio Scandurra 96538354b3 Express rightmost_point in terms of chars as opposed to bytes 2021-05-20 12:47:08 +02:00
Max BrunsfeldandAntonio Scandurra 510f20411a Get cursor movement working with byte columns
Introduce `clip_point` and `clip_offset` methods on `Rope`, `Buffer`, and `FoldMap`.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-05-20 12:47:08 +02:00
Max Brunsfeld c62a679e12 Use chunk-wise DisplayMap iteration when laying out lines 2021-05-20 12:47:08 +02:00
Max Brunsfeld a9583d0074 Introduce FoldMapSnapshot::chunks_at, use it in FoldMap::text
Get the FoldMap randomized tests passing. This also required adding
a test-only FoldMap::prev_char_boundary method.
2021-05-20 12:47:08 +02:00