Commit Graph

431 Commits

Author SHA1 Message Date
Nathan Sobo
ab3bbe1e17 Make the tabs scrollable when they overflow
This adds the ability to make a Flex element scrollable by passing a type tag and instance id, which we use to store the scroll position in an ElementStateHandle.

Still need to allow the element to auto-scroll.
2022-04-05 19:58:15 -06:00
Nathan Sobo
4f4364d510 Ensure we drop the last pane item
Previously, we weren't updating the toolbar's active item when emptying out a pane. This enhances an integration test to ensure that we don't hold references to any editors or buffers once we close everything.
2022-04-05 13:05:14 -06:00
Antonio Scandurra
c3b947ca26 Show unsaved/conflict prompt only when closing the last tab for an item
Also, ensure we show the correct prompt when files have conflicts.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-04-05 19:38:27 +02:00
Antonio Scandurra
cac0dddb1b Restructure item closing to take the Workspace instead of the Pane 2022-04-05 19:12:17 +02:00
Antonio Scandurra
5ef484c9a1 Update followers when navigating back and forth 2022-04-05 10:42:35 +02:00
Max Brunsfeld
9c469f2fdb Add remaining logic for downloading updates, add status bar indicator 2022-04-04 18:34:14 -07:00
Nathan Sobo
9702ab0075
Merge pull request #719 from zed-industries/misc-breadcrumbs-bugs
Fix miscellaneous breadcrumbs bugs
2022-04-04 05:42:55 -06:00
Antonio Scandurra
089b0e8e0f Remove duplicate activation logic when removing items from pane 2022-04-03 13:00:39 +02:00
Antonio Scandurra
80b599c4ef Prompt to save untitled buffers when closing them while they are dirty 2022-04-03 12:43:33 +02:00
Antonio Scandurra
d0a17f8c2c Update toolbar and automatically unfollow when navigating back and forth 2022-04-02 16:32:50 +02:00
Antonio Scandurra
e93ab4db14 Prompt before closing buffer with unsaved changes or conflicts 2022-04-01 14:33:07 +02:00
Antonio Scandurra
703f1c3be0 Introduce workspace::Item::reload to manually trigger a reload 2022-04-01 14:02:49 +02:00
Antonio Scandurra
cd5389b4d8 Let toolbar items specify flex when they have a primary location 2022-04-01 10:55:38 +02:00
Antonio Scandurra
7f9ff47089 Hide breadcrumbs when project search has no results 2022-04-01 10:00:21 +02:00
Antonio Scandurra
9f939bd007 Fix styling of project search bar 2022-04-01 09:59:36 +02:00
Nathan Sobo
903810f22e Style search in buffer below breadcrumbs
We still have issues with project search styling.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-03-31 11:44:16 -06:00
Nathan Sobo
8bfac63e0d Render the search UI on a separate row from the breadcrumbs
- In project search, render it above the breadcrumbs
- In buffer search, render it below

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-03-31 10:36:39 -06:00
Antonio Scandurra
0453dd1101 Allow flex items to float to the end of the flex axis
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-30 16:46:14 +02:00
Antonio Scandurra
9df2dacd85 Restructure Pane to have a single Toolbar with multiple items 2022-03-29 11:48:21 +02:00
Antonio Scandurra
d296bb21a8 Emit Event::PaneAdded in Workspace when a new pane is created 2022-03-29 10:24:42 +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
bb9b36dccd Add initial vim mode mode switching
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-03-25 20:10:37 -07:00
Nathan Sobo
a3e9a3afbf Clear out project registration and sharing state on disconnect
Previously, we weren't fully clearing the state associated with projects and worktrees when losing connection. This caused us to not see guest avatars disappear and not be able to re-share upon reconnect.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-25 10:15:08 -06:00
Antonio Scandurra
5cd94b5b92 WIP 2022-03-23 19:05:46 +01:00
Antonio Scandurra
60b6b0b317 Cycle through panes spatially rather than in the order in which they created
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-23 15:06:25 +01:00
Antonio Scandurra
4f27049305 Focus followed items when they become active if the pane is active
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-23 14:41:48 +01:00
Antonio Scandurra
edc038a1cf Activate previous pane and next pane via cmd-k cmd-left and cmd-k cmd-right
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-23 14:26:00 +01:00
Nathan Sobo
097bbe3e07 Update follow binding, remove unfollow binding
The previous binding to follow had ergonomics issues for the frequency that I think we'll want to use it. It would also conflict with the sub-word selection binding.

Now that moving the cursor etc unfollows, I don't think we need the follow binding.
2022-03-23 06:19:35 -06:00
Max Brunsfeld
880eaa268b Coalesce followed view updates only within one frame
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-22 17:03:24 -07:00
Max Brunsfeld
4435d9b106 Combine updates from multiple view events when updating followers
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-22 16:22:42 -07:00
Max Brunsfeld
c105802b2d Allow customizing the pane's following border width in the theme 2022-03-22 13:32:25 -07:00
Antonio Scandurra
284a446be7 WIP 2022-03-22 13:35:37 +01:00
Antonio Scandurra
016fb01ef8 Merge branch 'main' into follow 2022-03-22 11:20:55 +01:00
Antonio Scandurra
e5a99cf8cd Stop following when leader disconnects 2022-03-22 11:16:04 +01:00
Antonio Scandurra
ffaf409a31 Forget last pane's leader when such pane is removed
This is just a memory optimization and doesn't cause any observable
change in behavior.
2022-03-22 11:06:52 +01:00
Antonio Scandurra
7d566ce455 Follow last collaborator or the next one via cmd-alt-shift-f 2022-03-22 10:16:58 +01:00
Antonio Scandurra
67dbc3117d Stop following when activating a different item on the follower pane 2022-03-22 09:42:37 +01:00
Antonio Scandurra
3117554568 Automatically unfollow when editing, scrolling or changing selections 2022-03-22 09:17:01 +01:00
Max Brunsfeld
c550fc3f01 WIP - Start work on unfollowing automatically 2022-03-21 21:52:28 -07:00
Max Brunsfeld
c8f36af823 Show borders around avatars and panes to indicate following state 2022-03-21 15:12:15 -07:00
Max Brunsfeld
06cd9ac664 Match the leader's last selection when unfollowing
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-21 14:04:55 -07:00
Max Brunsfeld
3e0bc979c3 Avoid infinite loop when collaborators follow each other
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-21 11:47:00 -07:00
Antonio Scandurra
13a2dacc60 💄 2022-03-21 18:16:06 +01:00
Antonio Scandurra
9575796f9e Allow unfollowing of leaders by clicking on their avatar 2022-03-21 17:10:23 +01:00
Antonio Scandurra
a154e4500b Implement Workspace::unfollow
This also changes the structure of the follow state back to be per-pane. This
is because we can't share the same view state across different panes for
a couple of reasons:

- Rendering the same view in N different panes is almost always not something
that we want due to global state such as focus.
- If we allowed it and a user followed the same person in two different panes,
there would be no way of unfollowing in one pane without also unfollowing in
the other.
2022-03-21 16:55:18 +01:00
Antonio Scandurra
a2dbebd9ba Hide cursor both locally and remotely when following 2022-03-21 15:16:56 +01:00
Nathan Sobo
7cb8935ff5 Pass project entry id to Pane when opening a project items
This fixes an oversight where we were failing to associate project items with their project entry ids, which broke the logic that prevented the same project entry from being opened twice in the same pane.
2022-03-20 08:54:20 -06:00
Max Brunsfeld
570c987455 Handle view updates when following
Basic following now works. Editors' scroll positions
are their only replicated view state.
2022-03-18 15:56:57 -07:00
Max Brunsfeld
e338da0271 Allow clicking a titlebar avatar to initiate following 2022-03-18 13:37:07 -07:00
Max Brunsfeld
d860ed25c1 Allow FollowableItem::to_state_message to return None
This way, we can avoid a panic if we don't handle certain cases,
like a non-singleton editor.
2022-03-18 13:36:05 -07:00
Max Brunsfeld
d02ab9bd06 Start work on updating editors's scroll positions when following
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-18 12:56:20 -07:00
Max Brunsfeld
2c53175566 Rename FollowedItem -> FollowableItem
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-18 10:12:51 -07:00
Antonio Scandurra
f4520d4184 WIP 2022-03-18 18:07:03 +01:00
Antonio Scandurra
7d7e10598a Broadcast active view to followers 2022-03-18 16:00:03 +01:00
Antonio Scandurra
3d81eb9ddf Allow accessing workspace after adding item to pane 2022-03-18 14:59:53 +01:00
Antonio Scandurra
10e6d82c3e WIP: Start on sending view updates to followers 2022-03-18 14:20:09 +01:00
Antonio Scandurra
f0b7bd6e17 Serialize initial follow state in leader and reflect it in follower 2022-03-18 10:22:13 +01:00
Max Brunsfeld
0fdaa1d715 WIP 2022-03-17 17:53:49 -07:00
Max Brunsfeld
5702737de2 Start work on an integration test for following 2022-03-17 13:53:06 -07:00
Max Brunsfeld
845457e2c4 Always read project entry id from workspace::Item
We cannot store a workspace item's project entry id separately,
since buffers' entry ids can change (for example when doing
a *save as*).

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-17 10:58:20 -07:00
Max Brunsfeld
9716ff7964 Set up logic for starting following
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-17 10:46:54 -07:00
Antonio Scandurra
2b4738d82d Avoid passing a closure to workspace::register_project_item
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-03-17 17:39:25 +01:00
Antonio Scandurra
5d14c9abdf Introduce workspace::register_project_item
This lets downstream crates like `editor` define how project items should be
opened.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-17 15:54:34 +01:00
Antonio Scandurra
bff414cfbc Remove Editor::find_or_create
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-17 15:13:47 +01:00
Antonio Scandurra
44d997c00c Rename app_state to global in gpui
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-17 14:33:01 +01:00
Antonio Scandurra
84bacc556f Rename build_editor to build_item in Pane::open_item
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-17 14:31:05 +01:00
Antonio Scandurra
6446660c88 Rename open_buffer_for_path to open_buffer 2022-03-17 11:42:13 +01:00
Antonio Scandurra
e6755f4115 Search only in active pane when using Editor::find_or_create 2022-03-17 11:39:39 +01:00
Antonio Scandurra
a691c2fbdb Delete unused code 2022-03-17 11:33:58 +01:00
Antonio Scandurra
0efce8f70a Rename ItemView to Item 2022-03-17 11:32:46 +01:00
Antonio Scandurra
aced1e2315 Finish refactoring of how editors are opened 2022-03-17 11:29:46 +01:00
Nathan Sobo
728c708150 WIP: Massage opening of editors
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-03-16 17:40:09 -06:00
Nathan Sobo
1f9885ec42 Remove open_item_in_pane
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Keith Simmons <keith@the-simmons.net>
2022-03-16 16:08:13 -06:00
Nathan Sobo
0036e5c86c Replace ProjectEntry struct with ProjectEntryId
Previously, we tracked the worktree_id and entry_id separately, but now that entry ids are unique across all worktrees this is unnecessary.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Keith Simmons <keith@the-simmons.net>
2022-03-16 15:59:47 -06:00
Max Brunsfeld
a88320dc5f Remove workspace::Item trait
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Keith Simmons <keith@zed.dev>
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2022-03-16 13:34:06 -07:00
Max Brunsfeld
3a439f141d Open settings file in new window if current window isn't local
Co-Authored-By: Keith Simmons <keith@zed.dev>
2022-03-14 17:12:07 -07:00
Antonio Scandurra
bae44d8132 Re-render workspace when removing an inactive pane
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-14 15:49:08 +01:00
Max Brunsfeld
b33a049958 Merge branch 'main' into settings-file 2022-03-13 10:43:23 -07:00
Max Brunsfeld
20fed599b2 Start work on relaying settings to language servers 2022-03-11 17:36:27 -08:00
Max Brunsfeld
48848de82c Store settings as a global via a gpui app_state 2022-03-11 15:58:58 -08:00
Max Brunsfeld
7a68b2d371 Provide JSON language server with settings schema 2022-03-11 11:46:22 -08:00
Keith Simmons
17ac240511
Merge pull request #586 from zed-industries/global-events
Global Events

Co-authored-by: Max Brunsfeld <nathan@zed.dev>
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-03-11 11:42:25 -08:00
Keith Simmons
144591d639 Minor renames for clarity 2022-03-11 11:25:36 -08:00
Max Brunsfeld
6091caee8e Merge branch 'main' into settings-file 2022-03-11 10:04:17 -08:00
Nathan Sobo
fd36b25db1
Merge pull request #587 from zed-industries/lsp-progress
Show language server progress in the status bar
2022-03-11 10:57:24 -07:00
Antonio Scandurra
7a454003fe Show the last in-progress task from language servers 2022-03-11 09:59:13 +01:00
Keith Simmons
81fc812221 Add global events to MutableAppContext and raise global event when new workspace is created 2022-03-10 20:03:01 -08:00
Keith Simmons
b62daebde1
Merge pull request #563 from zed-industries/mouse-history-navigation
Add missing mouse button events and mouse history navigation
2022-03-10 17:39:36 -08:00
Antonio Scandurra
5157b42896 Extract a LanguageServerStatus struct 2022-03-10 18:43:56 +01:00
Antonio Scandurra
45fb470f4d Display language server name in status bar 2022-03-10 16:48:43 +01:00
Antonio Scandurra
4243f0c339 Render pending language server work in status bar 2022-03-10 16:09:47 +01:00
Max Brunsfeld
83f98dde52 Start work on loading settings from a file
Co-Authored-By: Keith Simmons <keith@zed.dev>
2022-03-09 17:59:29 -08:00
Keith Simmons
6ee0cceb14 Switch to using mouse navigation events instead of other in order to get rid of opaque button id 2022-03-09 15:04:04 -08:00
Keith Simmons
5aad1ff788 formatting fixes 2022-03-09 10:42:27 -08:00
Keith Simmons
b440a51675 Make theme selector eagerly display the selected theme 2022-03-08 18:42:31 -08:00
Keith Simmons
fc36c706d3 Add missing mouse button events and mouse history navigation
Co-Authored-By: Max Brunsfeld
Co-Authored-By: Nathan Sobo
2022-03-08 15:45:36 -08:00
Max Brunsfeld
5cc5fa2f93 Populate environment from shell
Co-Authored-By: Keith Simmons <keith@zed.dev>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-07 16:39:50 -08:00
Antonio Scandurra
711de5edcb Ensure active_item_index doesn't go off the end when closing items
This fixes a bug introduced in #538, where closing the current tab would hide
all the other tabs, if the current tab was the last one.

Also, this commit manually sets the active item index instead of calling
`Pane::activate_item`: even though this introduces a little bit of duplication,
it prevents us from mistakenly calling `deactivate` on the wrong item. This would
happen because `activate_item` looks at `self.active_item_index` to determine
which item to deactivate before setting the new one. However, that index is
potentially invalid because `::close_items` manipulates the `item_views` vector,
so `activate_item` could end up calling `deactivate` on an item view that was
not active in the first place.
2022-03-05 10:52:55 +01:00
Antonio Scandurra
c7ddb66795
Merge pull request #538 from zed-industries/close-inactive-items
Implement close inactive items
2022-03-05 10:35:22 +01:00
Nathan Sobo
8b9f41175b Use the macOS standard binding instead of VS Code's
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-03-04 10:39:11 -07:00
Nathan Sobo
3057b38fad Implement close inactive items action
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-03-04 10:36:51 -07:00
Antonio Scandurra
38313abc48 Disable events when project becomes read-only
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-04 17:37:37 +01:00
Antonio Scandurra
77e913b5a4 Blur focused view when project becomes read-only
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-04 17:37:26 +01:00
Antonio Scandurra
b21d91db22 Render overlay after remote project becomes read-only
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-04 17:28:18 +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
Antonio Scandurra
68cfce1fb8 Rename weak to visible
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-03-02 14:38:16 -08:00
Antonio Scandurra
07c780bd72 Make pane active when activating one of its items 2022-03-02 16:52:35 +01:00
Nathan Sobo
cb230ad574 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
e96d0a9355 Activate the *newest* existing project find view on cmd-shift-F 2022-02-26 14:03:14 -07:00
Nathan Sobo
60710fa5d5 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 Sobo
721258911c 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 Scandurra
e278c423d3 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
b506db7c93 Use the new split pane's navigation history when cloning an item 2022-02-25 17:22:30 +01:00
Max Brunsfeld
47b654063e 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
Max Brunsfeld
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
Nathan Sobo
c752383042
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 Brunsfeld
79910ba931 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
4295df1603
Merge pull request #457 from zed-industries/find-improvements
Find improvements
2022-02-21 10:34:49 -08:00
Antonio Scandurra
aee479d615 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
8913ec6cfd
Merge pull request #455 from zed-industries/rename
Introduce rename support via `F2`
2022-02-19 11:07:39 +01:00
Antonio Scandurra
78ce479496 Notify toolbars if active item changes independently of visibility 2022-02-18 16:31:52 +01:00
Antonio Scandurra
38e4ec9157 Replace Inconsolata with Zed Mono and Zed Sans 2022-02-18 14:55:11 +01:00
Antonio Scandurra
514d69e83d Merge branch 'main' into rename 2022-02-18 09:11:05 +01:00
Max Brunsfeld
10580f96a3 Automatically include current view id in element state ids 2022-02-17 13:44:46 -08:00
Max Brunsfeld
6d8db5f6bb 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 Brunsfeld
d173e4ef3c 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
809b843ceb Render "Sign in" label only for current user 2022-02-15 09:17:32 +01:00
Antonio Scandurra
2fcdcac080 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
4929b8c525 Move Buffer::format to Project::format 2022-02-11 12:07:46 +01:00
Max Brunsfeld
b67be5ded3 Add MultiBufferItemHandle
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-09 17:09:03 -08:00
Antonio Scandurra
7db4cad9e0 Fix panic when closing pane's last item 2022-01-31 10:10:15 +01:00
Antonio Scandurra
611538f6bd Clear highlighted matches when dismissing FindBar 2022-01-31 09:58:03 +01:00
Nathan Sobo
b1639e5677 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
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
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
Max Brunsfeld
c9b4bb78f2 Merge branch 'project-diagnostics-pinned-tab' into style-project-diagnostics 2022-01-25 12:20:37 -08:00
Max Brunsfeld
0cfb9ff1ae Add random delays in FakeFs
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-24 16:50:38 -08:00
Antonio Scandurra
31dfd01fda 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
19751e9200 Merge remote-tracking branch 'origin/main' into go-to-definition 2022-01-21 11:12:38 -07:00
Nathan Sobo
a73671e57c Revert "Replace project_path with project_entry in workspace::{Item, ItemView}"
This reverts commit 9c9a09cccb.
2022-01-21 11:07:10 -07:00
Antonio Scandurra
6e7e86e491 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
fbca28337a When opening a path in an existing window, move it to the foreground 2022-01-20 20:45:30 -07:00
Antonio Scandurra
377e41a90f 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
c450945001 WIP 2022-01-20 18:11:37 +01:00
Antonio Scandurra
b6685a532c 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
cbbf7391e8 Start on Project::definition that only works locally (for now) 2022-01-20 12:11:41 +01:00
Antonio Scandurra
71082d4cdc Return a Task<Result<()>> in {ItemView,Buffer,MultiBuffer}::save 2022-01-20 09:58:24 +01:00
Antonio Scandurra
634340dd84 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
0992132a0d Always open buffers via the project 2022-01-19 14:48:54 -08:00
Antonio Scandurra
ae284c2d8a Route save_as via the Project
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-19 18:44:48 +01:00
Antonio Scandurra
9c9a09cccb Replace project_path with project_entry in workspace::{Item, ItemView} 2022-01-19 15:56:04 +01:00
Antonio Scandurra
18f1040c85 Rename Navigation to NavHistory 2022-01-19 15:27:34 +01: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
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
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
ed88fdcea2 Add unit test for diagnostic + path header ordering 2022-01-12 11:34:57 -08:00
Max Brunsfeld
6865a42df9 Show error+warning counts in project diagnostics tab
Allow workspace items' tab contents to be arbitrary elements

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-12 10:51:28 -08:00
Max Brunsfeld
a0a558318c In diagnostics editor, attempt to open excerpts in a different pane
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-10 16:33:25 -08:00
Max Brunsfeld
c7eb6a6a60 Tweak color of share icon in titlebar 2022-01-10 11:26:07 -08:00
Antonio Scandurra
1a53d5b7ba Use a new Workspace::activate_item API in project diagnostics
Previously, we would only activate the pane without switching the
pane's *active item*.
2022-01-10 10:10:11 +01:00
Max Brunsfeld
ce6f3d7f3e Reuse views when moving between diagnostic view and editors
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-07 11:00:12 -08:00
Max Brunsfeld
ea263822fa Finish implementing ProjectDiagnostics::open_excerpts
* Build workspace item views with a reference to the workspace
* Add randomized test for MultiBuffer::excerpted_buffers and fix a small bug

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-07 09:59:27 -08:00
Antonio Scandurra
e5c520a265 Use Buffer handles instead of MultiBuffer as editor workspace items
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-07 17:48:31 +01:00
Antonio Scandurra
794d214eee Refactor opening workspace items
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-07 17:38:37 +01:00
Antonio Scandurra
3cab32d201 WIP: Add keybinding to open buffers under cursors
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-07 16:12:50 +01:00
Max Brunsfeld
1f762e482d Unify Flexible and Expanded elements
We'll use the name Expanded for something else now.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-06 17:29:34 -08:00
Antonio Scandurra
b2f0c78924 Merge branch 'main' into polish-project-diagnostics
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-04 18:35:28 +01:00
Antonio Scandurra
508b9dc024 Rip out "diagnostic providers" 2022-01-04 16:32:17 +01:00
Max Brunsfeld
a4027aacb5 Introduce a WorktreeId struct, fix incorrect use of remote worktrees' handle id 2022-01-04 11:28:44 +01:00
Max Brunsfeld
a080ae98c6 Allow the zed app to connect to both the old and new rpc endpoints
In the case of the new Next.js app, the app will follow a redirect
from 'zed.dev/rpc' to the subdomain where the rust service is hosted.
Until then, the app will connect directly to zed.dev/rpc.
2022-01-03 15:29:26 -08:00
Antonio Scandurra
a85e400b35 Start on a DiagnosticProvider implementation for Rust
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-24 16:22:22 +01:00
Antonio Scandurra
89c0b358a7 Allow sharing/unsharing of projects 2021-12-21 12:45:20 +01:00
Antonio Scandurra
17094ec542 Allow opening of remote projects via the contacts panel 2021-12-21 12:05:38 +01:00
Antonio Scandurra
40da3b233f Get more integration tests passing 2021-12-21 09:50:11 +01:00
Max Brunsfeld
55910c0d79 Get the server and integration tests compiling 2021-12-20 16:30:29 -08:00
Max Brunsfeld
466a377e1d Merge branch 'main' into share-project
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-20 11:42:59 -08:00
Max Brunsfeld
614ee4eac7 Send worktree info only when sharing worktree
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-20 11:36:59 -08:00
Nathan Sobo
e4f18947de Insert a time heading when creating a journal entry 2021-12-18 10:38:54 -07:00
Nathan Sobo
9e8ef31452 Return item handles when opening items
This will support interacting with the opened item. Although I think I should probably return the ItemView rather than the Item. Next commit.
2021-12-18 08:26:57 -07:00
Nathan Sobo
ca0d7e5e1f Add journal crate and move supporting logic into workspace crate
I needed to interact with the workspace to open a file from the journal crate, so I moved a bunch of logic out of main related to opening new workspaces and paths.
2021-12-18 08:12:59 -07:00
Antonio Scandurra
88d663a253 Allow saving of all buffers contained in project diagnostics editor
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-17 16:48:16 +01:00
Max Brunsfeld
6ab795c629 Handle buffer deduping in the worktree instead of in workspace
Previously, buffers were only deduped by file if they were opened
through Workspace::open_entry
2021-12-13 16:35:46 -08:00
Max Brunsfeld
026c3476db Upgrade tree-sitter to 0.20.1 2021-12-05 21:37:08 -08:00
Nathan Sobo
1445ce10b5 Name the root file of every crate after the crate to ease navigation
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-11-30 12:46:39 -07:00
Antonio Scandurra
b9edde7b26 Make settings fields that can be overridden private
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-29 17:08:43 +01:00
Antonio Scandurra
93de2bcfed Allow overriding editor settings on a per-language basis 2021-11-29 09:39:13 +01:00
Nathan Sobo
815cc7ee91 Give avatar ribbons a rounded top 2021-11-28 14:04:31 -07:00
Nathan Sobo
fbc307cd5e Associate collaborator avatars with "ribbons" corresponding to their cursor color 2021-11-28 13:25:05 -07:00
Nathan Sobo
a5039cad65 Tweak avatar sizes in titlebar 2021-11-28 12:41:46 -07:00
Nathan Sobo
6ce76ca13e Render active worktree collaborator avatars in the titlebar 2021-11-28 12:28:10 -07:00
Nathan Sobo
9930e92412 WIP: Give worktrees a reference to the UserStore
This will allow them to fetch user data when peers are added or removed. Still work to do though.
2021-11-26 19:12:12 -07:00
Antonio Scandurra
0d8c68ae1d Replace signed out silhouette with a "Sign in" label 2021-11-25 10:34:03 +01:00
Antonio Scandurra
afdac15572 Move integration test up into the zed crate 2021-11-24 17:39:15 +01:00
Antonio Scandurra
e88d3bb97e Invert dependency between editor and workspace
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-24 17:07:16 +01:00
Antonio Scandurra
2cf44d30b7 🔥
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-24 16:17:41 +01:00
Antonio Scandurra
03bd6d6c33 Pull up diagnostic and cursor position status bar items creation 2021-11-24 16:04:24 +01:00
Antonio Scandurra
9bb195e177 Introduce "entry openers" but still register editors in workspace 2021-11-24 15:18:15 +01:00
Max Brunsfeld
447f710570
Merge pull request #226 from zed-industries/1d-block-map
Allow full diagnostic messages to be displayed in the editor
2021-11-19 09:16:49 -08:00
Antonio Scandurra
b0afc80678 Ignore diagnostics with empty ranges
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-19 16:30:26 +01:00
Antonio Scandurra
401b59be5c Refactor retrieving oldest and newest selection
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-18 15:18:35 +01:00
Max Brunsfeld
61b9179fb1
Merge pull request #222 from zed-industries/fix-hover-beachball
Give the MouseEventHandlers for each tab bar their own id
2021-11-03 19:38:04 -07:00
Nathan Sobo
0ff87e603f Give the MouseEventHandlers for each tab bar their own id
This fixes a beachball where we oscillate back and forth between hovered and unhovered due to confusing two different tab bars as the same tab bar.
2021-11-03 19:15:55 -06:00
Nathan Sobo
44e0a00734 Only show the first line of diagnostic messages in the status bar
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-11-03 16:52:32 -06:00
Max Brunsfeld
1ec31738e6 Improve styling of diagnostic status bar item 2021-11-03 14:15:22 -07:00
Max Brunsfeld
8b5089c759 In the status bar, show the diagnostic under the cursor 2021-11-03 12:33:16 -07:00
Antonio Scandurra
c07d794249 Avoid ending the pending selection until updating selections
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-11-03 19:07:06 +01:00
Antonio Scandurra
a26b066788 Introduce a status bar and add the cursor position to it
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-11-03 17:27:51 +01:00
Max Brunsfeld
8d3f42de52 Start language servers based on buffers' languages
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-02 17:41:01 -07:00
Max Brunsfeld
89392cd23d Avoid using worktree handle in File's path methods
This avoids a circular model update that was happening
when trying to retrieve the absolute path from a buffer's
file while applying remote operations.
2021-11-02 14:33:55 -07:00
Max Brunsfeld
4069db4959 Allow underlines to have different color than the text
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-26 12:46:46 -07:00
Antonio Scandurra
0674e76864 WIP 2021-10-26 19:42:40 +02:00
Max Brunsfeld
81a85e9c79 Extract a language crate 2021-10-20 22:51:40 +02:00
Antonio Scandurra
724272931a Skip autoclosed pairs
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-10-06 19:04:55 +02:00
Antonio Scandurra
05d7e9c4e7 Start on autoclosing pairs
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-06 16:34:57 +02:00
Max Brunsfeld
3cb7ba0f57 Make the fields of buffer::Language private 2021-10-05 14:19:33 -07:00
Antonio Scandurra
499616d769 Move workspace module into its own crate 2021-10-05 13:49:10 +02:00
Antonio Scandurra
5105596918 Move sidebar-specific code out of Workspace 2021-10-05 10:59:20 +02:00