Store some vim state per-editor

This fixes a bug where opening and closing command would reset your
selection incorrectly.
This commit is contained in:
Conrad Irwin 2023-08-17 13:35:32 -06:00
parent d308c91020
commit 3514816ece
12 changed files with 106 additions and 48 deletions

View file

@ -4,7 +4,7 @@ use language::Point;
use crate::{motion::Motion, utils::copy_selections_content, Mode, Vim};
pub fn substitute(vim: &mut Vim, count: Option<usize>, cx: &mut WindowContext) {
let line_mode = vim.state.mode == Mode::VisualLine;
let line_mode = vim.state().mode == Mode::VisualLine;
vim.switch_mode(Mode::Insert, true, cx);
vim.update_active_editor(cx, |editor, cx| {
editor.transact(cx, |editor, cx| {