Revert "Remove into SelectionEffects
from .change_selections"
This reverts commit 28380d714d
.
This commit is contained in:
parent
28380d714d
commit
6e762d9c05
65 changed files with 625 additions and 837 deletions
|
@ -1,6 +1,5 @@
|
|||
use crate::{Vim, motion::Motion, object::Object, state::Mode};
|
||||
use collections::HashMap;
|
||||
use editor::SelectionEffects;
|
||||
use editor::{Bias, Editor, display_map::ToDisplayPoint};
|
||||
use gpui::actions;
|
||||
use gpui::{Context, Window};
|
||||
|
@ -89,7 +88,7 @@ impl Vim {
|
|||
let text_layout_details = editor.text_layout_details(window);
|
||||
editor.transact(window, cx, |editor, window, cx| {
|
||||
let mut selection_starts: HashMap<_, _> = Default::default();
|
||||
editor.change_selections(SelectionEffects::no_scroll(), window, cx, |s| {
|
||||
editor.change_selections(None, window, cx, |s| {
|
||||
s.move_with(|map, selection| {
|
||||
let anchor = map.display_point_to_anchor(selection.head(), Bias::Right);
|
||||
selection_starts.insert(selection.id, anchor);
|
||||
|
@ -107,7 +106,7 @@ impl Vim {
|
|||
IndentDirection::Out => editor.outdent(&Default::default(), window, cx),
|
||||
IndentDirection::Auto => editor.autoindent(&Default::default(), window, cx),
|
||||
}
|
||||
editor.change_selections(SelectionEffects::no_scroll(), window, cx, |s| {
|
||||
editor.change_selections(None, window, cx, |s| {
|
||||
s.move_with(|map, selection| {
|
||||
let anchor = selection_starts.remove(&selection.id).unwrap();
|
||||
selection.collapse_to(anchor.to_display_point(map), SelectionGoal::None);
|
||||
|
@ -129,7 +128,7 @@ impl Vim {
|
|||
self.update_editor(window, cx, |_, editor, window, cx| {
|
||||
editor.transact(window, cx, |editor, window, cx| {
|
||||
let mut original_positions: HashMap<_, _> = Default::default();
|
||||
editor.change_selections(SelectionEffects::no_scroll(), window, cx, |s| {
|
||||
editor.change_selections(None, window, cx, |s| {
|
||||
s.move_with(|map, selection| {
|
||||
let anchor = map.display_point_to_anchor(selection.head(), Bias::Right);
|
||||
original_positions.insert(selection.id, anchor);
|
||||
|
@ -141,7 +140,7 @@ impl Vim {
|
|||
IndentDirection::Out => editor.outdent(&Default::default(), window, cx),
|
||||
IndentDirection::Auto => editor.autoindent(&Default::default(), window, cx),
|
||||
}
|
||||
editor.change_selections(SelectionEffects::no_scroll(), window, cx, |s| {
|
||||
editor.change_selections(None, window, cx, |s| {
|
||||
s.move_with(|map, selection| {
|
||||
let anchor = original_positions.remove(&selection.id).unwrap();
|
||||
selection.collapse_to(anchor.to_display_point(map), SelectionGoal::None);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue