Commit Graph

753 Commits

Author SHA1 Message Date
Max Brunsfeld
05bf8f61e2 Avoid changing selection in buffer navigation dialogs
If an editor has highlighted_rows, autoscroll it to reveal those rows instead of
its cursor positions.
2022-01-18 17:29:33 -08:00
Max Brunsfeld
2cae706033 Limit the storage used by the navigation history 2022-01-18 16:31:48 -08:00
Max Brunsfeld
926306582b Add a unit test for navigation behavior at the editor level 2022-01-18 16:25:22 -08:00
Max Brunsfeld
f7326b8d74 Push to navigation history based on jump distance instead of time 2022-01-18 15:02:49 -08:00
Antonio Scandurra
16b82d59f1 Experiment with a more general way of pushing editor navigation entries 2022-01-18 18:03:10 +01:00
Antonio Scandurra
0cae3e0ac0 Ensure focus is transferred when opening the first item in pane 2022-01-18 10:15:37 +01:00
Antonio Scandurra
b7091dd5e2 Fix double borrow error when closing an item 2022-01-18 10:13:50 +01:00
Antonio Scandurra
4f472e1442 🔥 2022-01-18 10:10:16 +01:00
Antonio Scandurra
bb954e29cf Introduce a test to verify navigation 2022-01-18 10:03:56 +01:00
Antonio Scandurra
d5acbe1e32 Use offset to restore navigation position if anchor can't be resolved 2022-01-18 09:59:28 +01:00
Antonio Scandurra
d480738cc5 Skip past entries in the navigation history that can't be re-opened 2022-01-18 09:58:40 +01:00
Max Brunsfeld
11b7270f68 Navigate to previous positions in editors when using navigation history 2022-01-17 16:01:52 -08:00
Max Brunsfeld
e43d33cdad WIP - Reopen closed items when going back in nav history 2022-01-17 10:46:47 -08:00
Antonio Scandurra
ea624c6cde Populate backward/forward stacks upon item deactivation
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-17 18:57:31 +01:00
Antonio Scandurra
bbf634f439 Start laying the foundation for a per-pane navigation system 2022-01-17 16:59:06 +01:00
Antonio Scandurra
cd0d1d3340 Delete unused pane::State struct 2022-01-17 15:27:54 +01:00
Antonio Scandurra
f51cf6b05e Cleanup worktrees' shared state when unsharing 2022-01-17 10:58:49 +01:00
Antonio Scandurra
466b26e7e6 Always re-render outline view when changing the active selection 2022-01-17 10:17:11 +01:00
Max Brunsfeld
e27fafb824 v0.12 2022-01-14 12:03:29 -08:00
Max Brunsfeld
485554cd0c
Merge pull request #342 from zed-industries/symbolic-nav
Introduce outline view
2022-01-14 12:02:43 -08:00
Max Brunsfeld
f3239fe1d5 Apply scroll_max after uniform list autoscrolls 2022-01-14 11:56:28 -08:00
Max Brunsfeld
dd8e5ee543 Add bottom margin to the outline view 2022-01-14 11:01:20 -08:00
Max Brunsfeld
5de5e4b6f2 Avoid panic in OutlineView when active item isn't an editor 2022-01-14 10:51:26 -08:00
Max Brunsfeld
b7561c6cef Add select_first and select_last bindings to outline view
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-14 10:45:37 -08:00
Max Brunsfeld
ea69dcd42a Match on names only when outline query has no spaces
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-14 09:16:29 -08:00
Antonio Scandurra
ce51196eab Center the selected item when updating outline query
Co-Authored-By: Max Brunsfeld <max@zed.dev>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-14 17:53:06 +01:00
Antonio Scandurra
e4c0fc6ad5 Dismiss outline view when the query editor is blurred
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-14 17:25:24 +01:00
Nathan Sobo
b52db22544 Only enable smart case if the query contains an uppercase character
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-01-14 09:16:09 -07:00
Nathan Sobo
f934370e7f Match full path when query contains spaces
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-01-14 09:02:04 -07:00
Antonio Scandurra
be24e58926 Associate StringMatchCandidate with an id
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-14 14:55:03 +01:00
Antonio Scandurra
e538beb920 Highlight matches by increasing the font weight
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-14 14:39:15 +01:00
Antonio Scandurra
a64ba8b687 Allow matching of context items in outline view 2022-01-14 11:09:02 +01:00
Antonio Scandurra
e7f1398f3a 💄 2022-01-14 10:20:04 +01:00
Antonio Scandurra
b0033bb6d4 Don't emit duplicate text when mixing syntax highlighting and match indices 2022-01-14 10:08:08 +01:00
Antonio Scandurra
ecba761e18 Make mod a @context 2022-01-14 09:22:20 +01:00
Antonio Scandurra
deb679b8f5 Report all matching strings in fuzzy matcher even if they're duplicates 2022-01-14 09:16:39 +01:00
Antonio Scandurra
9c1f58ee89 Maintain order of outline items when filling out tree's missing parts 2022-01-14 09:12:30 +01:00
Max Brunsfeld
adeb7e6864 Incorporate syntax highlighting into symbol outline view
Still need to figure out how to style the fuzzy match characters
now that there's syntax highlighting. Right now, they are
underlined in red.
2022-01-13 18:10:02 -08:00
Max Brunsfeld
7913a1ea22 Include highlighting runs in Outline 2022-01-13 14:46:15 -08:00
Max Brunsfeld
3e1c559b2d Allow multiple disjoint nodes to be captured as matcheable in the outline query 2022-01-13 14:04:25 -08:00
Max Brunsfeld
950b06674f Add more items to rust outline query 2022-01-13 12:01:36 -08:00
Max Brunsfeld
f2cef0b795 Implement navigation via outline modal
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-01-13 11:48:44 -08:00
Max Brunsfeld
373fe6fadf Change Editor::set_highlighted_row to take a row range
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-01-13 09:49:46 -08:00
Antonio Scandurra
055d48cfb2 Select the closest outline item when the outline view's query is empty
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-13 18:43:49 +01:00
Antonio Scandurra
2660d37ad8 Return Outline<Anchor> from MultiBuffer::outline
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-13 18:24:00 +01:00
Antonio Scandurra
e165f1e16c Use OutlineItem::depth to include ancestors of matching candidates
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-13 16:59:52 +01:00
Antonio Scandurra
aee3bb98f2 Implement selecting prev and next in outline view
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-13 16:44:06 +01:00
Antonio Scandurra
d74658fdb5 Allow searching of outline items 2022-01-13 15:10:50 +01:00
Antonio Scandurra
06ba1c64cf Implement Outline::search 2022-01-13 15:10:29 +01:00
Antonio Scandurra
5e64f1aca8 Report the candidate's index when matching strings 2022-01-13 15:09:27 +01:00