Commit Graph
123 Commits
Author SHA1 Message Date
Antonio Scandurra 680f16b96b Make pane active when activating one of its items 2022-03-02 16:52:35 +01:00
Nathan Sobo 874b1c1537 Re-activate the most recently-activated project search on cmd-shift-F
This commits adds the beginnings of an application state facility as a non-static place to store the most recently-activated search for each project.

I also store workspace items by descending order of their entity id so that we always fetch the newest item of a given type when calling `Workspace::item_of_type`.
2022-02-27 18:07:46 -07:00
Nathan Sobo a4ba94d506 Activate the *newest* existing project find view on cmd-shift-F 2022-02-26 14:03:14 -07:00
Nathan Sobo 47088e9bf4 Only store one nav history entry when opening excerpts
Also: Introduce the ability to disable and enable the nav history directly. This allows us to explicitly push an entry when opening excerpts and then disable all pushes as we open individual buffers.
2022-02-25 19:26:15 -07:00
Nathan SoboandMax Brunsfeld b212b31d0a Open excerpts on alt-enter
Also: Remove special handling for alt-shift-D binding in diagnostics view that opens excerpts. Rely on alt-enter in all multi-buffers instead.
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-02-25 16:49:28 -07:00
Antonio ScandurraandMax Brunsfeld 55ec98b42c Don't assume that cloning on split will reuse the same underlying model
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-02-25 18:30:04 +01:00
Antonio Scandurra d15fb9c3dc Use the new split pane's navigation history when cloning an item 2022-02-25 17:22:30 +01:00
Max BrunsfeldandNathan Sobo 20d923b53e Provide editor styling information separately from editor settings
* Since regular editors' font sizes and families are controlled by
  the settings and not the theme, don't store a dummy text style in
  the theme. Instead, only store a font color, and synthesize
  the text style for regular editors using both the theme and the
  settings.
* Style single-line and auto-height editors (now called "field
  editors") using a single function that takes the entire theme and
  selects a relevant sub-object.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-24 16:42:00 -08:00
b43945d6c6 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
Nathan Sobo 43036ed7b4 Merge pull request #459 from zed-industries/spurious-macro-errors
Download language servers dynamically on startup
2022-02-21 17:08:50 -08:00
Max BrunsfeldandNathan Sobo 79a0d152a3 Show more information in lsp status bar item
* Distinguish between checking for updates and downloading
* Show dismissable error message when downloading failed and there
  is no cached server.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-21 16:11:51 -08:00
Nathan Sobo fbbf89fac2 Merge pull request #457 from zed-industries/find-improvements
Find improvements
2022-02-21 10:34:49 -08:00
Antonio ScandurraandNathan Sobo ec875ff474 Show message indicating when we're downloading language servers
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-21 17:25:52 +01:00
Antonio Scandurra c17dd8386f Merge pull request #455 from zed-industries/rename
Introduce rename support via `F2`
2022-02-19 11:07:39 +01:00
Antonio Scandurra 3588de1958 Notify toolbars if active item changes independently of visibility 2022-02-18 16:31:52 +01:00
Antonio Scandurra 099f4fab72 Replace Inconsolata with Zed Mono and Zed Sans 2022-02-18 14:55:11 +01:00
Antonio Scandurra f6e7347138 Merge branch 'main' into rename 2022-02-18 09:11:05 +01:00
Max Brunsfeld 0da0b2611e Automatically include current view id in element state ids 2022-02-17 13:44:46 -08:00
Max Brunsfeld 9479826046 Convert some project tests to use FakeFs
Also, tweak some FakeFs methods to make them slightly more convenient.
2022-02-17 11:09:27 -08:00
Max BrunsfeldandAntonio Scandurra 705efeb013 Fix non-unique ids passed to MouseEventHandlers
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-02-17 09:44:02 -08:00
Antonio Scandurra c483bc64ad Render "Sign in" label only for current user 2022-02-15 09:17:32 +01:00
Antonio ScandurraandNathan Sobo 85cdfddb31 Fetch code actions on cursor movement instead of on-demand
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-11 14:41:19 +01:00
Antonio Scandurra e035758ba9 Move Buffer::format to Project::format 2022-02-11 12:07:46 +01:00
Max BrunsfeldandNathan Sobo ffc2260958 Add MultiBufferItemHandle
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-09 17:09:03 -08:00
Antonio Scandurra 580b52251a Fix panic when closing pane's last item 2022-01-31 10:10:15 +01:00
Antonio Scandurra 7c9f25e956 Clear highlighted matches when dismissing FindBar 2022-01-31 09:58:03 +01:00
Nathan Sobo 12e7a0bafd Add cmd-g and cmd-shift-g to jump to next / previous result
I added the action handler on Pane so we can use these bindings when the find bar isn't focused.
2022-01-30 20:59:20 -07:00
Max Brunsfeld 9fb2c2cda2 Avoid panic when closing the last tab in a pane, due to calling activate_item 2022-01-27 15:38:10 -08:00
Max BrunsfeldandNathan Sobo 77ac1c92f0 Inform toolbars when active item changes
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-27 13:00:23 -08:00
b76c7f9aab 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
b485554e64 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
Max Brunsfeld 0bee9ad4f8 Merge branch 'project-diagnostics-pinned-tab' into style-project-diagnostics 2022-01-25 12:20:37 -08:00
Max BrunsfeldandNathan Sobo 82bcd0528e Add random delays in FakeFs
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-24 16:50:38 -08:00
Antonio Scandurra 41100c4439 Make add_local_worktree private and use find_or_create_local_worktree
The former always adds a worktree, even if we have one already in the
project and that could be misused. The public API should always search
for a local worktree containing the requested path first so that the
project can uphold invariants about which worktrees it has.
2022-01-22 11:23:00 +01:00
Nathan Sobo e9e76ee3ed Merge remote-tracking branch 'origin/main' into go-to-definition 2022-01-21 11:12:38 -07:00
Nathan Sobo 5e45a8f1aa Revert "Replace project_path with project_entry in workspace::{Item, ItemView}"
This reverts commit c5fe187527.
2022-01-21 11:07:10 -07:00
Antonio Scandurra ba96ca0b1b Remove weak worktrees from project when nobody references them
Also, avoid showing them in the project panel as well as in the
contacts panel.
2022-01-21 14:34:14 +01:00
Nathan Sobo 8daf3ad771 When opening a path in an existing window, move it to the foreground 2022-01-20 20:45:30 -07:00
a8684fe004 Make navigation history work with project diagnostics
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-20 18:21:48 +01:00
Antonio Scandurra 3c1b7e26c9 WIP 2022-01-20 18:11:37 +01:00
Antonio ScandurraandNathan Sobo ade37e946c Make "go to definition" work in project diagnostics
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-20 17:30:30 +01:00
Antonio Scandurra 911d6f708c Start on Project::definition that only works locally (for now) 2022-01-20 12:11:41 +01:00
Antonio Scandurra ef78225a5d Return a Task<Result<()>> in {ItemView,Buffer,MultiBuffer}::save 2022-01-20 09:58:24 +01:00
Antonio Scandurra 897e0b4a7a Return a task from Workspace::save_active_item
This required changing our approach to OS prompts and this commit greatly
simplifies that. We now avoid passing a callback and return a simple future
instead. This lets callers spawn tasks to handle those futures.
2022-01-20 09:51:29 +01:00
Max Brunsfeld 09719a0bfc Always open buffers via the project 2022-01-19 14:48:54 -08:00
Antonio ScandurraandMax Brunsfeld 841827f873 Route save_as via the Project
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-19 18:44:48 +01:00
Antonio Scandurra c5fe187527 Replace project_path with project_entry in workspace::{Item, ItemView} 2022-01-19 15:56:04 +01:00
Antonio Scandurra 6702f048eb Rename Navigation to NavHistory 2022-01-19 15:27:34 +01:00
Max Brunsfeld 3bb1cdc35c Limit the storage used by the navigation history 2022-01-18 16:31:48 -08:00
Max Brunsfeld ef52932a63 Add a unit test for navigation behavior at the editor level 2022-01-18 16:25:22 -08:00