Commit Graph
126 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 41590ef64b Merge branch 'main' into test-branch 2022-10-11 19:55:32 -07:00
Mikayla Maki 0beb97547e Finished refactoring out fs and rope 2022-10-11 15:25:54 -07:00
K Simmons b82db3a254 Adds word and sentence text objects along with a new vim testing system which uses cached neovim data to verify our test accuracy 2022-10-08 21:51:49 -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
Max Brunsfeld 26fdaeb92b Use new marked ranges format whenever we don't need overlapping ranges 2022-08-04 10:23:03 -07:00
Max Brunsfeld 8e6fb76681 Use new marked_ranges format in more editor tests 2022-08-03 20:04:47 -07:00
Antonio Scandurra 385d214b47 Enhance DisplayMap randomized test to change tab size
This removes the need for a unit test.
2022-08-03 12:01:26 +02:00
Antonio Scandurra d1f155337f Recompute layers above tab map entirely when tab size changes
Previously, we wouldn't generate any `TabEdit` when the tab size
changed, causing coordinate spaces in `WrapMap` and `BlockMap` to
become outdated.

This commit generates a synthetic edit that covers the entire `TabMap`
to ensure layers above are synchronized.
2022-08-03 11:06:17 +02:00
Max BrunsfeldandMikayla Maki fa5af4383d Introduce AutoindentMode parameter to Buffer::edit
This controls whether or not we preserve the relative indentation
of inserted text blocks.

Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
2022-07-28 14:03:31 -07:00
Antonio Scandurra 97ce3998ec Position IME input according to where the selection is rendered 2022-07-21 17:35:40 +02:00
Max Brunsfeld f985515141 Start work on new text input handling in Editor 2022-07-20 16:45:27 -07:00
Max Brunsfeld ec8a493700 Move all default settings from source code into the JSON file 2022-07-12 11:35:19 -07:00
Keith Simmons 92ab107fc9 working jump to definition with tests 2022-06-24 15:09:31 -07:00
Max Brunsfeld c91451a1b2 Merge pull request #1234 from zed-industries/fix-editor-cloning
Clone fold and selection state correctly when splitting an editor
2022-06-23 13:27:40 -07:00
Max Brunsfeld fb2a7787a1 Clone fold and selection state correctly when splitting an editor 2022-06-23 13:15:50 -07:00
Keith Simmons 755636d10e Use NonZeroU32 to ensure settings tabsize cannot be zero 2022-06-23 12:55:38 -07:00
Antonio ScandurraandNathan Sobo 2cb8a3ccfb Don't override top-level settings with language defaults
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-06-23 16:40:57 +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 8826ad5ddd Make Buffer::edit and MultiBuffer::edit resilient to inverted ranges
Previously, we would accept edits containing out-of-order ranges. When
generating such ranges in our randomized tests, many invariants started
breaking causing e.g. undo/redo to misbehave and operation application
to panic.

In theory, we should never pass inverted ranges, but this commit changes
the above functions to swap the start and the end when that occurs to avoid
breaking the entire system and panicking.
2022-06-06 15:22:36 +02:00
Keith Simmons e93c49f4f0 Unify visual line_mode and non line_mode operators 2022-05-26 17:02:05 -07:00
Keith Simmons 61f0daa5c5 Visual line mode handles soft wraps 2022-05-26 17:02:05 -07:00
Keith Simmons 37c921f972 Initial visual mode 2022-05-10 11:12:28 -07: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
Keith Simmons 5ea782de21 Add inclusive vs exclusive motions to vim mode 2022-04-21 16:50:23 -07:00
Antonio Scandurra 52251c3463 Merge pull request #745 from zed-industries/scroll-tabs
Allow pane tabs to be scrolled when they overflow
2022-04-07 09:48:54 +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
Max BrunsfeldandKeith Simmons 866ffdd4ae Move Settings to its own crate
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-06 10:23:33 -07:00
Nathan Sobo eb99588368 Remove stray dbg! expressions 2022-04-05 20:02:45 -06:00
Antonio ScandurraandNathan Sobo 45ecd8e0a6 Always use square brackets in marked_text_ranges
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-28 17:11:35 +02:00
Nathan Sobo d4436277ee Merge pull request #682 from zed-industries/vim-hjkl
Vim hjkl
2022-03-26 07:11:46 -06:00
Keith Simmons 1a29180185 Fixed issue with enabling and disabling vim mode dynamically
Also added indoc and marked text utility to vim tests to improve readability
2022-03-25 20:10:52 -07:00
Keith SimmonsandNathan Sobo 0aaf270650 Add clip_to_line_end to display_map/snapshot and set it to ensure vim positioning in normal mode
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-03-25 20:10:52 -07:00
Nathan Sobo 2c232d585a Merge branch 'main' into unfold-on-select-match 2022-03-24 14:13:27 -06:00
ab631cf6c3 Change language::anchor::min() to a constant
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-03-24 10:41:33 -07:00
Antonio Scandurra 4f50da759a Allow customizing whether FoldMap::unfold treats ranges as inclusive 2022-03-24 17:14:41 +01:00
Max BrunsfeldandKeith 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
Keith Simmons df751867a1 Remove results from movement function return values, and move editor test utilities to test file 2022-03-22 10:55:03 -07:00
Nathan Sobo f70f4c7729 Improve DisplayPoint Debug impl 2022-03-21 21:07:56 -06:00
Antonio Scandurra fbf7cdf4f2 Make all HighlightStyle properties optional
Previously, some of those properties such the font weight, style and color
would be mandatory: when the theme didn't specify them, Zed would use a default
value during deserialization. This meant that those default properties would
unconditionally override the base text style, causing a rendering bug when
combining syntax highlights with diagnostic styles.

This commit fixes that by making `HighlightStyle`s more additive: each property
can be set independently and only the properties that theme specifies get
overridden in the base text style.
2022-03-15 10:39:43 +01:00
Nathan Sobo c35a96c425 On rename, replace background highlights with transparent text highlights 2022-03-11 15:54:17 -07:00
Nathan Sobo 951fd1ab36 Merge branch 'main' into select-on-rename 2022-03-11 15:30:07 -07: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
64098247cb Allow languages to be registered at any time
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-02-22 10:35:20 -08:00