Keith Simmons
755636d10e
Use NonZeroU32 to ensure settings tabsize cannot be zero
2022-06-23 12:55:38 -07:00
Antonio Scandurra
6f7a893ec9
Determine Buffer::is_dirty based on the rope's fingerprint
2022-06-17 12:38:25 +02:00
Antonio Scandurra
c31a233aad
Introduce a new fingerprint field to TextSummary
...
This is calculated in `Rope` and uses the `bromberg_sl2` homomorphic
hash function to determine the fingerprint of a single chunk and
compose each chunk fingerprint into a single fingerprint for the entire
rope that is equivalent to hashing all the rope's bytes at once.
2022-06-17 12:12:37 +02:00
Antonio Scandurra
666ea61dbc
Introduce a new BlockStyle field for blocks
...
This new field allows blocks to specify how they want to be laid out:
- If `Fixed` they can take up all the width they want and they will impact
the scroll width of the editor. This is useful for diagnostic messages and
allows scrolling the editor further to the right to visualize the entire message.
- If `Flex` they can extend all the way to the scroll width without impacting it
any further. This is useful for the rename editor that we insert as a block
decoration when hitting `F2`.
- If `Sticky`, they will be as wide as the editor element and won't participate
in the horizontal scrolling of the editor. This is useful for headers in general,
where we want e.g. the filename and the jump button to always be visible
independently of how much the user has scrolled to the right.
2022-06-10 13:47:40 +02: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
712d47d94f
Render a "Jump to Buffer" icon on all excerpt headers
2022-06-08 15:31:29 +02:00
Antonio Scandurra
eda569d6b2
Snapshot file instead of path when creating a buffer snapshot
2022-06-08 14:29:14 +02:00
Antonio Scandurra
ffb75b0f02
Extract an ExcerptRange containing a context field in multi_buffer
...
This lays the groundwork for adding an optional `primary` field that can
be supplied to provide the "jump to" feature.
2022-06-08 12:13:04 +02:00
Antonio Scandurra
aefdde66a6
Pass a &mut BlockContext when rendering blocks
...
This wraps and derefs to `RenderContext<Editor>`, so that we can
easily use `MouseEventHandler`s in blocks.
2022-05-31 15:50:34 +02:00
Antonio Scandurra
c0bf4a5bfd
Bump FoldSnapshot version if excerpt gets edited outside of its bounds
...
This will cause layers above `FoldMap` to grab a fresh snapshot of the `FoldMap`
and, as a result, of the underlying `MultiBufferSnapshot`. It is a necessary change
because, even though the coordinate space is not affected, a buffer edit taking place
*before* an excerpt range could cause the excerpt buffer rows to change, e.g. if
lines were added or removed. This manifested itself in a randomized test.
2022-05-18 10:13:18 +02:00
Keith Simmons
b4b61b4bbc
Consolidate edit and edit_batched functions
2022-04-28 16:52:04 -07:00
Keith Simmons
04fc1d5982
Building, but failing test WIP
2022-04-27 17:25:38 -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
Antonio Scandurra
91d4c835ad
Introduce TabMap::line_len
2022-04-14 12:55:33 +02:00
Keith Simmons and Max 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
2c232d585a
Merge branch 'main' into unfold-on-select-match
2022-03-24 14:13:27 -06:00
Keith Simmons and Nathan Sobo
92c7b5d6ef
Remove result from anchor cmp functions
...
Co-authored-by: Nathan Sobo <nathan@zed.dev >
2022-03-24 11:48:31 -07:00
Antonio Scandurra
1c25b3d150
Test the new inclusive parameter when unfolding
2022-03-24 17:20:28 +01:00
Antonio Scandurra
4f50da759a
Allow customizing whether FoldMap::unfold treats ranges as inclusive
2022-03-24 17:14:41 +01:00
Max Brunsfeld and Keith Simmons
ff4bdb3114
Fix incorrect highlighting when an empty range is highlighted via the DisplayMap
...
Co-Authored-By: Keith Simmons <keith@zed.dev >
2022-03-23 18:20:55 -07:00
Antonio Scandurra and Nathan Sobo
7155dabf5b
Fade out unnecessary code
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-15 15:51:59 +01:00
Antonio Scandurra and Nathan Sobo
a6d0caf557
Don't seek FilterCursor upon creation
...
This lets us use `next` or `prev` to decide whether to park the cursor
at the first or last filtered item.
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-15 15:13:23 +01:00
Nathan Sobo
33bcd6d904
Merge remote-tracking branch 'origin/main' into select-on-rename
2022-03-12 10:10:23 -07:00
Nathan Sobo
951fd1ab36
Merge branch 'main' into select-on-rename
2022-03-11 15:30:07 -07:00
Antonio Scandurra
c67cfd7fe1
Respect excerpt's range when comparing two anchors both belonging to it
2022-03-11 12:42:22 +01:00
Nathan Sobo
e6b1fea117
WIP
2022-03-10 11:32:14 -07:00
Nathan Sobo
ac1eb19f83
Start on text highlight support
2022-03-09 20:51:35 -07:00
Nathan Sobo
49e38e6e00
Eliminate ToFoldPoint trait
...
Just make it a method on FoldMap
2022-03-09 20:49:18 -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
5b4c0d64bc
Get tests passing and project diagnostics view working w/ new excerpt headers
2022-02-09 13:51:52 -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
cbf59ffafb
Handle replacing trailing empty excerpt with another empty excerpt
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
Co-Authored-By: Max Brunsfeld <max@zed.dev >
2022-02-09 19:38:18 +01: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 Scandurra and Nathan 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 and Nathan Sobo
f1e3d5285b
Fix randomized test failures on BlockMap with excerpt headers
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-02-09 15:17:40 +01:00
Antonio Scandurra
0e1318dfe4
WIP: Make editor crate compile again
...
Tests are still failing though.
2022-02-09 11:09:11 +01:00
Max Brunsfeld and Nathan Sobo
c7e2fae9cb
WIP - Add excerpt headers as a built-in feature of BlockMap
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-02-08 18:15:45 -08: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
Max Brunsfeld
a890787923
Render header blocks as horizontall fixed (like the gutter)
...
Tweak editor layout to perform horizontal autoscroll before
laying out the blocks, so that they can access the scroll position.
2022-01-25 17:19:38 -08:00
Max Brunsfeld and Nathan Sobo
cefb63936d
Tweak diagnostic header styling
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-01-25 15:33:49 -08:00
Nathan Sobo and Max Brunsfeld
0c6fd157ee
Scale diagnostic headers icons with editor font and right align w/ line numbers
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2022-01-25 12:40:53 -07:00
Max Brunsfeld and Nathan Sobo
1a672929e0
Adjust BlockMap tests to reflect new tiebreaking behavior
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-01-12 12:11:55 -08:00
Max Brunsfeld and Nathan Sobo
6ad9ff10c1
Ensure path headers appear before first diagnostic header
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-01-12 10:51:28 -08:00
Max Brunsfeld
b5ee095da9
Deduplicate path names in the project diagnostics view
2022-01-12 10:51:08 -08:00
Antonio Scandurra
0742640b39
Correctly report line boundaries when a map contains both folds and wraps
...
This fixes the randomized test failures that were occurring on main.
2022-01-10 11:26:48 +01:00