global editor mode setting
Co-authored-by: Oleksiy Syvokon <oleksiy.syvokon@gmail.com>
This commit is contained in:
parent
27a26d53b1
commit
0d5becfadf
11 changed files with 93 additions and 78 deletions
|
@ -4,7 +4,7 @@ use gpui::{Action, Context, Window, actions};
|
|||
use language::SelectionGoal;
|
||||
use settings::Settings;
|
||||
use text::Point;
|
||||
use vim_mode_setting::HelixModeSetting;
|
||||
use vim_mode_setting::{EditorMode, EditorModeSetting};
|
||||
use workspace::searchable::Direction;
|
||||
|
||||
actions!(
|
||||
|
@ -53,7 +53,7 @@ impl Vim {
|
|||
self.update_editor(cx, |_, editor, cx| {
|
||||
editor.dismiss_menus_and_popups(false, window, cx);
|
||||
|
||||
if !HelixModeSetting::get_global(cx).0 {
|
||||
if EditorModeSetting::get_global(cx).0 != EditorMode::Helix {
|
||||
editor.change_selections(Default::default(), window, cx, |s| {
|
||||
s.move_cursors_with(|map, mut cursor, _| {
|
||||
*cursor.column_mut() = cursor.column().saturating_sub(1);
|
||||
|
@ -63,7 +63,7 @@ impl Vim {
|
|||
}
|
||||
});
|
||||
|
||||
if HelixModeSetting::get_global(cx).0 {
|
||||
if EditorModeSetting::get_global(cx).0 == EditorMode::Helix {
|
||||
self.switch_mode(Mode::HelixNormal, false, window, cx);
|
||||
} else {
|
||||
self.switch_mode(Mode::Normal, false, window, cx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue