Commit graph

638 commits

Author SHA1 Message Date
Antonio Scandurra
021699e51c Implement shift-f8 to go to previous diagnostic
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-15 15:13:23 +01:00
Antonio Scandurra
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
Antonio Scandurra
45ce503afd Start on implementing filtering support for Cursor::prev 2022-03-15 15:13:23 +01: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
Max Brunsfeld
e7835caac4
Merge pull request #621 from zed-industries/autoclose-before-punctuation
Autoclose brackets before a language-specific set of characters
2022-03-14 15:33:47 -07:00
Max Brunsfeld
325e6c31ae Autoclose brackets before a language-specific set of characters
Fixes #588
2022-03-14 15:17:40 -07:00
Max Brunsfeld
2c25e619b4 Respect theme's background color when rendering field editors 2022-03-14 14:24:51 -07:00
Max Brunsfeld
e392368d89 Fix layout panic on empty editors with blocks
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-14 12:03:26 -07:00
Antonio Scandurra
21eebede37 Add more assertions to investigate #503 in the future 2022-03-14 16:53:39 +01:00
Antonio Scandurra
a3ea6a34d9 Ensure there's at least one selection in Editor::set_selections
This commit introduces an assertion that will cause Zed to panic as
soon as the invariant gets violated. This will be useful to investigate
issue #503.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-14 16:17:14 +01:00
Max Brunsfeld
b33a049958 Merge branch 'main' into settings-file 2022-03-13 10:43:23 -07:00
Nathan Sobo
992fc07133 Hide selections in original editor when renaming
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-12 10:45:11 -07:00
Nathan Sobo
308cead8a8 🙊
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-12 10:44:11 -07:00
Nathan Sobo
9f629fa307 Improve selection handling when pending rename is taken
- Set selection to the intuitive cursor position when moving up rather than restoring the full selection of the rename editor.
- When cancelling, restore the original selection.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-12 10:30:57 -07:00
Nathan Sobo
33bcd6d904 Merge remote-tracking branch 'origin/main' into select-on-rename 2022-03-12 10:10:23 -07:00
Nathan Sobo
4f086b8d7a Refresh document highlight after rename, but not during
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-12 10:10:06 -07:00
Antonio Scandurra
965f82ec31
Merge pull request #589 from zed-industries/fold-map-test-failures
Avoid re-using excerpt IDs in `MultiBuffer`
2022-03-12 17:59:48 +01:00
Antonio Scandurra
dd1711d53f Account for all excerpts ever inserted when determining new excerpt ID 2022-03-12 17:50:09 +01:00
Antonio Scandurra
cd4a9f3178 Fix bug in selection position maintenance while renaming symbol
We were resolving the selection with the wrong buffer, which now
causes a panic because we don't check the anchor's `buffer_id` anymore.
2022-03-12 13:03:45 +01:00
Max Brunsfeld
48848de82c Store settings as a global via a gpui app_state 2022-03-11 15:58:58 -08: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
Keith Simmons
87b1cfe34f
Merge pull request #576 from zed-industries/cursor-shape
Add support for rendering the cursor as a Block and Underscore

Co-authored-by: Max Brunsfeld <max@zed.dev>
2022-03-11 11:51:24 -08:00
Antonio Scandurra
71aa5e5360 💄 2022-03-11 17:13:28 +01:00
Antonio Scandurra
a74b602f18 Assume the anchor is valid if we can find an excerpt that contains it 2022-03-11 17:08:12 +01:00
Nathan Sobo
5407f25c94 Don't reuse excerpt ids in MultiBuffer
This prevents anchors from swapping their ordering, which was causing issues in FoldMap.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-11 08:50:50 -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
Keith Simmons
5f62f69907 Add unwrap check if buffer_line not available 2022-03-10 20:04:16 -08:00
Nathan Sobo
94bf3366f6 Focus in-progress rename editor when editor is focused 2022-03-10 16:42:20 -07:00
Nathan Sobo
a498cd32c8 When renaming, match the color of the renamed token in the rename editor 2022-03-10 16:38:45 -07:00
Nathan Sobo
69ce021f32 Remove unused variable 2022-03-10 15:27:29 -07:00
Nathan Sobo
3968b37e26 When renaming, fade out the old name and select all 2022-03-10 14:55:31 -07:00
Keith Simmons
5502c00d9a swap default cursor shape back to bar 2022-03-10 13:28:13 -08:00
Keith Simmons
5b35c68d2e Fix failing gpui test from missing cursor shape 2022-03-10 13:20:45 -08:00
Keith Simmons
eddb089f27 render character under block cursor 2022-03-10 13:16:31 -08:00
Nathan Sobo
e6b1fea117 WIP 2022-03-10 11:32:14 -07:00
Antonio Scandurra
ee6d7fc6d5 Delete till previous tabstop when backspacing within indent column 2022-03-10 10:28:24 +01:00
Keith Simmons
0d42c85195 fix formatting 2022-03-10 01:09:25 -08:00
Keith Simmons
178442a4a8 Add support for rendering cursors as a block and underscore 2022-03-10 01:09:02 -08: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
f15e3177d3
Merge pull request #569 from zed-industries/refine-autoclose
Refine bracket auto-closing behavior
2022-03-09 16:28:35 +01:00
Antonio Scandurra
97da93c9ec 💄 2022-03-09 15:44:58 +01:00
Antonio Scandurra
d9b3f04436 Surround selections with brackets when they are non-empty 2022-03-09 15:41:54 +01:00
Antonio Scandurra
f54ce8a19c Autoclose bracket only if next char is whitespace or the end of a pair 2022-03-09 15:38:17 +01:00
Max Brunsfeld
4cb4b99c56 Assign buffer's completion triggers from LSP capabilities
Also, make LanguageServer::new() async. The future resolves
once the server is initialized.
2022-03-08 17:41:52 -08:00
Antonio Scandurra
317a1bb07b Remove language servers from buffers
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
Co-Authored-By: Keith Simmons <keith@zed.dev>
2022-03-08 15:16:07 -08:00
Antonio Scandurra
29cad65ce0 Open untitled buffers via the Project
This allows the registration of such buffers in the project, which is necessary
to correctly support `::save_buffer_as` and opens the door to sharing untitled
buffers with guests in the future.

Note that, for now, this disallows guests to create untitled buffers in the
current window and will create a new window instead. This is because we don't
yet have a global way of allocating a buffer's remote id (nor a way of saving
such buffers in the host's worktree) and we instead rely on the local model ID,
which could clash with the host's buffer IDs.

I think we should revisit this once guests can share their untitled buffers
with the host and other remote peers, as well as once we start keying
operations by entry id.
2022-03-04 15:25:39 +01:00
Antonio Scandurra
dc5a09b3f7
Merge pull request #525 from zed-industries/preserve-worktrees
Grow worktrees monotonically when sharing and move most messages to the background
2022-03-04 09:48:18 +01:00
Max Brunsfeld
05df1dfae9 Disable doctests for all libraries
We don't use them, and they add a lot of noise to the test output
when running all tests in the workspace.
2022-03-03 16:15:56 -08:00