-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix vi mode change not pastable #807
Fix vi mode change not pastable #807
Conversation
in vim the deleted text can be pasted, while previously that didn't happen in reedline
#[case(&['d', 'l'], ReedlineEvent::Multiple(vec![ReedlineEvent::Edit(vec![EditCommand::Delete])]))] | ||
#[case(&['2', 'd', 'd'], ReedlineEvent::Multiple(vec![ReedlineEvent::Edit(vec![EditCommand::CutCurrentLine]), ReedlineEvent::Edit(vec![EditCommand::CutCurrentLine])]))] | ||
// #[case(&['d', 'j'], ReedlineEvent::Multiple(vec![ReedlineEvent::Edit(vec![EditCommand::CutCurrentLine]), ReedlineEvent::Edit(vec![EditCommand::CutCurrentLine])]))] | ||
// #[case(&['d', 'k'], ReedlineEvent::Multiple(vec![ReedlineEvent::Up, ReedlineEvent::Edit(vec![EditCommand::CutCurrentLine]), ReedlineEvent::Edit(vec![EditCommand::CutCurrentLine])]))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the point of these commented out cases? Do they not work? Are they not supposed to work? Are we coming back to them later? etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They don't work. I would rather wait on adding them because (1) using this combination in vim is uncommon [citation needed] and (2) multi line edits in nushell is not very frequent, (3) there might be strange edge cases with the menu and (4) adding it will add onto the hacks and (5) we should cleanup before that as well as (6) other lower hanging fruit in the vi mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, thanks for the info. i'm good with this PR. ping me when you're ready to land. hopefully no other vim users have problems with it but "you snooze, you lose".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ready to land.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, we typically freeze PR merges when we're this close to a release (tuesday). so, we'll probably have to wait on this one.
Thanks |
While extending the tests for vi mode, I noticed that c$ (replace text until end of line with newly entered text) and cc (replace the entire line with newly entered text) don't actually cut the removed text. This fixed that. Verified with vim 9.1 that it should be cut a.k.a. pastable.
Test:
setup:
actual test:
both "cc p" and "c$ p" should now leave the text unchanged by cutting out text and pasting it back again (, but moving the cursor to the end).