Commit Graph

2823 Commits

Author SHA1 Message Date
Antonio Scandurra
9ce1eda305 Bind cmd-e to deploy FindBar without focusing it 2022-01-30 16:11:48 +01:00
Antonio Scandurra
ce5270488f Propagate Cancel when editor is not in full mode
This is consistent with what VS Code and Sublime Text do and allows the user to
perform only one keybinding to e.g. dismiss the find bar when the query is
(partially) selected.
2022-01-30 16:01:53 +01:00
Antonio Scandurra
c53b6b907a Populate query with text under selection when hitting cmd-f 2022-01-30 16:01:05 +01:00
Antonio Scandurra
2a1b1adfab Bind enter and shift-enter in FindBar 2022-01-30 15:20:57 +01:00
Antonio Scandurra
e8105c9a99 Show a message when no matches were found 2022-01-29 18:23:14 +01:00
Antonio Scandurra
c16bd98f56 Fix panic when no matches were found 2022-01-29 18:21:19 +01:00
Antonio Scandurra
969d81b632 Determine active match index correctly when cursor is after last match 2022-01-29 16:44:26 +01:00
Antonio Scandurra
df4cc45790 Select next/prev find match based on whether we intersect active match
Also, capture the next/prev selection logic in a unit test.
2022-01-29 16:16:48 +01:00
Antonio Scandurra
1d55872e7a Display active match and allow going to next or previous match
We still need to write a unit test for this, as well as add a keybinding.
2022-01-29 14:38:58 +01:00
Antonio Scandurra
5ebd24d528 📝 Improve assertion comment 2022-01-29 10:41:55 +01:00
Antonio Scandurra
a284e7140c Always return valid locations when refreshing anchors
Specifically, with this commit:

- We will now refresh the anchor if it escapes the boundaries of the excerpt by
using the `Excerpt::contains` method. This was not the case before, as we were
just checking if the excerpt id and buffer id of the anchors matched the ones
stored on the excerpt.
- We fixed a bug that was causing the anchor to be outside of the excerpt when
resetting it to one of the excerpt's endpoints after we couldn't keep its
position. This would happen because we were using `anchor_at`, which resolved
the anchor to an offset first and then converted it back into an anchor with
the given bias, which is a lossy operation. We now use `Anchor::bias` to
achieve the same goal: note that this could still lead to the anchor escaping
the excerpt's boundary when the bias doesn't match the endpoint's bias, so we
take extra care to avoid that and `min`/`max` the newly-produced anchor with
the other endpoint.
2022-01-29 10:10:53 +01:00
Antonio Scandurra
2d6e348185 Prevent anchors from escaping their excerpt's range when resolving them
This could happen if an anchor was created on an excerpt with a larger range.
Then, if the excerpt was removed and added back at the same position and with
the same buffer but a smaller range, resolving the anchor could overshoot
the excerpt's boundaries.
2022-01-29 09:52:38 +01:00
Max Brunsfeld
5c7cea5a3e WIP - Navigate to prev/next search result 2022-01-28 14:00:00 -08:00
Max Brunsfeld
7e02d669e1 Add a simple unit test for find bar 2022-01-28 13:05:29 -08:00
Max Brunsfeld
bfaeefc61d
Merge pull request #376 from zed-industries/bump-rust-analyzer
Bump rust-analyzer to the 2022-01-24 release
2022-01-28 13:24:24 -07:00
Max Brunsfeld
be7f5340d0 Adjust hover assertion in lsp test after bumping rust-analyzer 2022-01-28 12:11:26 -08:00
Antonio Scandurra
e1c12ffac2 Bump rust-analyzer to the 2022-01-24 release 2022-01-28 19:46:14 +01:00
Antonio Scandurra
d2a64f2171 Optimize search when regex doesn't contain newlines
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-28 17:26:08 +01:00
Antonio Scandurra
5b9d791269 Implement regex search with multiline support
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-28 16:15:18 +01:00
Antonio Scandurra
5c862bfe98 Maintain search results as query and active editor changes
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-28 15:19:58 +01:00
Antonio Scandurra
860e37d50f Move finding results in the background 2022-01-28 12:15:55 +01:00
Antonio Scandurra
b2ded5bca8 Optimize some common operations when MultiBuffer is a singleton 2022-01-28 11:50:13 +01:00
Antonio Scandurra
b980b11053 Implement whole word mode 2022-01-28 11:48:04 +01:00
Nathan Sobo
df1810a3b0 A bit more progress styling find
Fix the pinwheel when hovering mode buttons.
2022-01-27 18:59:44 -07:00
Max Brunsfeld
da35df0cca WIP 2022-01-27 16:16:51 -08:00
Max Brunsfeld
4f0ffdcdaf Avoid panic when closing the last tab in a pane, due to calling activate_item 2022-01-27 15:38:10 -08:00
Max Brunsfeld
3abd7bc8dd Highlight find matches
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-27 15:19:52 -08:00
Max Brunsfeld
34ed734749 Add highlighted_ranges API to editor
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-27 15:19:28 -08:00
Max Brunsfeld
d8e4464a89 WIP - Run substring search when typing in find bar
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-27 13:00:51 -08:00
Max Brunsfeld
05e20ca72b Inform toolbars when active item changes
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-27 13:00:23 -08:00
Antonio Scandurra
bebde782fa Deploy FindBar when hitting cmd-f
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-27 17:56:50 +01:00
Antonio Scandurra
e7d4c385d5 Take an Into<AnyViewHandle> in ChildView::new
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-27 17:54:45 +01:00
Antonio Scandurra
dbf48d2a5b
Merge pull request #375 from zed-industries/more-project-diagnostics-styling
Last touches on project diagnostics for now
2022-01-27 16:47:05 +01:00
Antonio Scandurra
24d1d2a2ef
Merge pull request #374 from zed-industries/fix-editor-panic
Fix editor panic when ending transaction that wasn't started by the same editor
2022-01-27 16:36:49 +01:00
Antonio Scandurra
3853826f78 Pause cursor blinking only when editor is focused
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-27 16:33:47 +01:00
Antonio Scandurra
37032f5eb2 Show non-disk-based diagnostics in project diagnostics
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-27 16:23:50 +01:00
Antonio Scandurra
ff24766319 Fix warning
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-27 15:55:48 +01:00
Antonio Scandurra
41ec4645ab Don't panic when ending transaction that wasn't started by the same editor
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-27 15:53:44 +01:00
Antonio Scandurra
f055053fc9 Avoid grouping transactions created by different editors
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-27 15:51:46 +01:00
Antonio Scandurra
4d9cdd474b Style empty project diagnostics state 2022-01-27 10:21:26 +01:00
Antonio Scandurra
adf00fafdf
Merge pull request #373 from zed-industries/empty-diagnostic-message
Filter out supporting diagnostics that contain no messages
2022-01-27 10:12:13 +01:00
Antonio Scandurra
3e4fe09d00 Filter out supporting diagnostics that contain no messages 2022-01-27 09:51:15 +01:00
Antonio Scandurra
dc95cd9e20
Merge pull request #371 from zed-industries/metal-debug
Add script to debug Metal frames
2022-01-27 08:56:05 +01:00
Antonio Scandurra
7b2f55fa62 Add script to debug Metal frames 2022-01-27 08:51:55 +01:00
Max Brunsfeld
2749001477 Use latest rust docker image 2022-01-26 12:54:51 -08:00
Max Brunsfeld
c054e4c9bf Use new feature resolver
This fixes a build failure on linux because gpui was being spuriously
included as a dependency of zed-server, due to its presence as an
optional dependency in the rpc crate.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-26 12:51:29 -08:00
Max Brunsfeld
0e55f0ccaa Use Rust 2021 edition in all crates
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-26 12:50:31 -08:00
Max Brunsfeld
509d362bdd Avoid stripping newlines before opening backticks in error messages 2022-01-26 11:51:12 -08:00
Max Brunsfeld
f1d621133e Dial back opacity of border.1 in dark themes 2022-01-26 11:27:00 -08:00
Max Brunsfeld
76bbd101c6 Increase diagnostic editor's vertical scroll margin
This way, the first path header will always be fully visible when
you move your cursor to the beginning of the multibuffer.
2022-01-26 10:23:41 -08:00