Commit Graph
704 Commits
Author SHA1 Message Date
Antonio Scandurra d980cab5d9 Test the new inclusive parameter when unfolding 2022-03-24 17:20:28 +01:00
Antonio Scandurra 47416066c4 Unfold range when selecting the next match
Selected matches are unfolded when in project search, buffer search and
when hitting `cmd-d` to select the next match.
2022-03-24 17:16:21 +01:00
Antonio Scandurra cd4e282144 Rename Editor::unfold to Editor::unfold_lines 2022-03-24 17:15:40 +01:00
Antonio Scandurra 3f8b9684ce Allow customizing whether FoldMap::unfold treats ranges as inclusive 2022-03-24 17:14:41 +01:00
Max Brunsfeld c23723cce2 Merge pull request #668 from zed-industries/no-lsp-when-following
Avoid making LSP requests when moving cursor due to following
2022-03-23 11:54:45 -07:00
Max Brunsfeld 1c58e616b9 Merge pull request #667 from zed-industries/fix-duplicate-nav-entries
Fix duplicate nav entries
2022-03-23 11:49:00 -07:00
Max Brunsfeld 00cee40996 Avoid making LSP requests when moving cursor due to following 2022-03-23 11:41:20 -07:00
Keith SimmonsandAntonio Scandurra b931215d49 Add navigation deduping
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-03-23 11:32:25 -07:00
Antonio Scandurra 27fbbeffe9 WIP 2022-03-23 19:05:46 +01:00
Antonio ScandurraandKeith Simmons 3dde930f6b Don't push a duplicate nav entry when changing selections via the mouse
Co-Authored-By: Keith Simmons <keith@zed.dev>
2022-03-23 18:45:45 +01:00
Max BrunsfeldandNathan Sobo 072fa2448c 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
Antonio Scandurra dd6c8a17e5 Merge pull request #662 from zed-industries/fix-refresh-selections-when-mouse-selecting
Account for pending selections when calling `Editor::refresh_selections`
2022-03-23 15:58:28 +01:00
Antonio ScandurraandNathan Sobo c6b87d4e9c Don't destroy pending selection on Editor::refresh_selections
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-23 15:21:11 +01:00
Antonio Scandurra 2f1b1abbb8 Merge pull request #661 from zed-industries/follow
Introduce basic following experience
2022-03-23 15:17:44 +01:00
Antonio ScandurraandNathan Sobo d94d39357d Don't show local cursors when editor is not focused
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-23 14:46:33 +01:00
Antonio Scandurra 831bddc331 Account for pending selections when calling Editor::refresh_selections 2022-03-23 11:46:35 +01:00
Max BrunsfeldandNathan Sobo 1d4061dcb9 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 1329824507 Add unit test for editor's following methods
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-22 17:39:34 -07:00
Max BrunsfeldandNathan Sobo a60cc61dd8 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 b920b865c4 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
Keith Simmons 8bf564ecf7 Add editor lifetime events 2022-03-22 16:14:32 -07:00
Keith Simmons 8d4deb8693 Add editor selection utilities
Also improved test that was failing during above to use marker text approach as a drive by
2022-03-22 16:08:22 -07:00
Max Brunsfeld 5d1658e1f1 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
Keith Simmons 3e22400212 Remove results from movement function return values, and move editor test utilities to test file 2022-03-22 10:55:03 -07:00
Antonio Scandurra 1b6236e3db Reflect leader's view state when recycling existing local editors 2022-03-22 10:51:17 +01:00
Antonio Scandurra 6e16603070 Always render local selections on top of remote ones 2022-03-22 10:31:28 +01:00
Antonio Scandurra 0de3f0980f Automatically unfollow when editing, scrolling or changing selections 2022-03-22 09:17:01 +01:00
Max Brunsfeld 0cc1f68b61 WIP - Start work on unfollowing automatically 2022-03-21 21:52:28 -07:00
Max Brunsfeld 8c5e1610b1 Always mirror the leader's selections when following 2022-03-21 21:47:29 -07:00
Nathan Sobo 3b5830d041 Make boundary-finding methods wrap across newlines
This requires word and subword methods to explicitly acknowledge that they want to stop at newlines, which I think actually increases clarity. It makes the boundary finding method more general and useful for external callers such as the forthcoming vim crate.
2022-03-21 21:25:02 -06:00
Nathan Sobo 47496eda80 Improve DisplayPoint Debug impl 2022-03-21 21:07:56 -06:00
Nathan Sobo ba73ef8861 Implement next_subword_end 2022-03-21 20:02:08 -06:00
acad71b1f5 WIP: Start on previous_subword_start
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Keith Simmons <keith@the-simmons.net>
2022-03-21 19:53:01 -06:00
Nathan Sobo 37420a1dd0 Extract logic for scanning over character boundaries 2022-03-21 16:01:22 -06:00
Nathan Sobo ffb280f963 Make multi-byte and surrounding_word tests more readable
Just merge multi-byte tests into the main word movement tests
2022-03-21 15:41:42 -06:00
Nathan SoboandKeith Simmons ce4280c12f Remove CharKind::Newline
This is just a character, and so it seems clearer to refer to it specifically when we want to know if a character is a newline. There was only one case where we relied on Newline being different from Whitespace, and we special-cased that instance. Changing this actually makes us match the behavior of VS Code when double-clicking runs of multiple newlines.

/cc @as-cii

Co-Authored-By: Keith Simmons <keith@the-simmons.net>
2022-03-21 15:17:32 -06:00
Nathan SoboandKeith Simmons 61b61e070f Clarify word movement function names and improve test coverage
Co-Authored-By: Keith Simmons <keith@the-simmons.net>
2022-03-21 15:17:25 -06:00
Max BrunsfeldandAntonio Scandurra 18848bd463 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 3cfde9b2e6 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 f04e08eb4b Hide cursor both locally and remotely when following 2022-03-21 15:16:56 +01:00
Antonio Scandurra 0ddc5453c0 Unset follower's scroll anchor when editor is scrolled all the way up 2022-03-19 10:50:23 +01:00
Max Brunsfeld 2163cacb0c 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 395d11d98b 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 70e323e4dc 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 f80a5578ec WIP 2022-03-18 18:07:03 +01:00
Antonio Scandurra 2831546bce Broadcast active view to followers 2022-03-18 16:00:03 +01:00
Antonio Scandurra 55322903a9 WIP: Start on sending view updates to followers 2022-03-18 14:20:09 +01:00
Antonio Scandurra d37930e006 Serialize initial follow state in leader and reflect it in follower 2022-03-18 10:22:13 +01:00
Max Brunsfeld 6360072b43 WIP 2022-03-17 17:53:49 -07:00
Max BrunsfeldandAntonio Scandurra 41d2ba294f 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