Commit Graph
101 Commits
Author SHA1 Message Date
Max BrunsfeldandKeith Simmons 866ffdd4ae Move Settings to its own crate
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-06 10:23:33 -07:00
Antonio Scandurra 703f1c3be0 Introduce workspace::Item::reload to manually trigger a reload 2022-04-01 14:02:49 +02:00
Antonio Scandurra 2c78c830eb Skip formatting during save if it takes too long 2022-03-28 11:02:20 +02:00
Antonio Scandurra 87981bb2ab Emit an Edited event when ending, undoing or redoing a transaction 2022-03-24 08:56:37 +01:00
Antonio Scandurra a739c362d9 Rename editor::Event::Edited to editor::Event::BufferEdited
This is to distinguish it from a new event we're about to add which
represent edits originating from that specific editor.
2022-03-24 08:55:46 +01:00
Max Brunsfeld cbd4ef2ec5 Merge pull request #667 from zed-industries/fix-duplicate-nav-entries
Fix duplicate nav entries
2022-03-23 11:49:00 -07:00
Antonio Scandurra 5cd94b5b92 WIP 2022-03-23 19:05:46 +01:00
Max BrunsfeldandNathan Sobo 0b3a63b843 Fix error in follower when leader creates pending selections
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-23 10:24:26 -07:00
Max BrunsfeldandNathan Sobo fa62fd968f Autoscroll when leader moves cursors
instead of copying their scroll top.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-22 18:02:54 -07:00
Max BrunsfeldandNathan Sobo 8699dd9c56 Replicate fractional component of leader's scroll position
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-22 17:20:13 -07:00
Max BrunsfeldandNathan Sobo 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 fc811e0856 Don't represent editor's scroll top anchor as an option
Use Anchor::min as the special value representing a scroll top of zero
2022-03-22 13:32:25 -07:00
Antonio Scandurra 5dc36260e5 Reflect leader's view state when recycling existing local editors 2022-03-22 10:51:17 +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 1728551282 Always mirror the leader's selections when following 2022-03-21 21:47:29 -07:00
Max BrunsfeldandAntonio Scandurra 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 BrunsfeldandAntonio Scandurra 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 a2dbebd9ba Hide cursor both locally and remotely when following 2022-03-21 15:16:56 +01:00
Antonio Scandurra 0e920ad5e9 Unset follower's scroll anchor when editor is scrolled all the way up 2022-03-19 10:50:23 +01: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 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 BrunsfeldandAntonio Scandurra 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
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 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 BrunsfeldandAntonio Scandurra 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
Antonio ScandurraandNathan Sobo bff414cfbc Remove Editor::find_or_create
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-17 15:13:47 +01:00
Antonio ScandurraandNathan Sobo 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 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 SoboandMax Brunsfeld 728c708150 WIP: Massage opening of editors
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-03-16 17:40:09 -06:00
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
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
Antonio ScandurraandNathan Sobo 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
Max Brunsfeld 48848de82c Store settings as a global via a gpui app_state 2022-03-11 15:58:58 -08:00
Nathan Sobo 7ef98fb935 Make versions oldest_selection and newest_selection that don't require snapshots
I thought I needed this but actually didn't, but I still kinda think it's a good change for the public interface of Editor.
2022-02-27 13:02:09 -07:00
Antonio ScandurraandMax Brunsfeld 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 BrunsfeldandNathan Sobo 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
Antonio ScandurraandNathan Sobo 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 8d3b7e996f Proceed with saving a buffer even if formatting fails 2022-02-12 13:02:19 +01:00
Max Brunsfeld d4b9d9e820 Inline MultiBuffer::format
Put all the logic in Editor. Add an `all_buffers` method so the editor can
format all of the buffers by itself.
2022-02-11 16:22:19 -08:00
Antonio Scandurra 3fc3e51a44 Fix panic when trying to render a diagnostic that has no message 2022-02-11 12:16:20 +01:00
Antonio Scandurra 4929b8c525 Move Buffer::format to Project::format 2022-02-11 12:07:46 +01:00
5049c1b286 Make Editor::newest_anchor_selection return a non-optional value
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-02-10 10:16:54 -07:00
Antonio Scandurra dd223f93ec Allow editor to be saved when in multi-buffer mode
Also, this commit enables the customization of the title in a multi-buffer.
When specified, it will take precedence over a filename (or "untitled").
2022-02-10 09:35:19 +01:00