vim: Fix accidental visual selection when following (#3068)

Release Notes:

- vim: Fix a bug where following could put you in visual mode
This commit is contained in:
Conrad Irwin 2023-09-29 13:59:59 -06:00 committed by GitHub
commit d9c1cf9874
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -195,6 +195,9 @@ impl Vim {
if editor_mode == EditorMode::Full
&& !newest_selection_empty
&& self.state().mode == Mode::Normal
// if leader_replica_id is set, then you're following someone else's cursor
// don't switch vim mode.
&& editor.leader_replica_id().is_none()
{
self.switch_mode(Mode::Visual, true, cx);
}