vim: Handle exclusive-linewise edgecase correctly (#27786)
Before this change we didn't explicitly handle vim's exclusive-linewise edgecase (https://neovim.io/doc/user/motion.html#exclusive). Instead we had hard-coded workarounds in a few places to make our tests pass. The most pernicious of these workarounds was that we represented a visual line selection as including the trailing newline (or leading newline for files that end with no newline), which other code had to undo to get back to what the user indended. Closes #21440 Updates #6900 Release Notes: - vim: Fixed `d]}` to not delete the closing brace - vim: Fixed `d}` from the start of the line to not delete the paragraph separator - vim: Fixed `d}` from the middle of the line to not delete the final newline
This commit is contained in:
parent
e1e8c1786e
commit
fc269dfaf9
27 changed files with 471 additions and 482 deletions
|
@ -3,6 +3,7 @@ use gpui::{actions, Action};
|
|||
use gpui::{Context, Window};
|
||||
use language::{CharClassifier, CharKind};
|
||||
|
||||
use crate::motion::MotionKind;
|
||||
use crate::{motion::Motion, state::Mode, Vim};
|
||||
|
||||
actions!(vim, [HelixNormalAfter, HelixDelete]);
|
||||
|
@ -254,7 +255,7 @@ impl Vim {
|
|||
});
|
||||
});
|
||||
|
||||
vim.copy_selections_content(editor, false, window, cx);
|
||||
vim.copy_selections_content(editor, MotionKind::Exclusive, window, cx);
|
||||
editor.insert("", window, cx);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue