Skip to content
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

<C-u> doesn't behave as expected in insert mode #2804

Closed
mrwest808 opened this issue Jul 4, 2018 · 1 comment · Fixed by #2805
Closed

<C-u> doesn't behave as expected in insert mode #2804

mrwest808 opened this issue Jul 4, 2018 · 1 comment · Fixed by #2805

Comments

@mrwest808
Copy link

Is this a BUG REPORT or FEATURE REQUEST? (choose one):
BUG REPORT

What happened:
text |text + <C-u> deletes whole line.

What did you expect to happen:
Keep text after current position, i.e. |text.

How to reproduce it (as minimally and precisely as possible):
Press <C-u> on any line where the cursor position isn't at the end of the line.

Environment:

  • Extension (VsCodeVim) version: v0.14.1
  • VSCode version: v1.24.1
  • OS version: macOS High Sierra v10.13.5

First off, thanks for a great Vim implementation!

I categorized this as a BUG REPORT because I feel that the behavior differs from how <C-u> behaves in normal Vim. I'm working on a solution for this locally, will add a PR.

mrwest808 pushed a commit to mrwest808/Vim that referenced this issue Jul 4, 2018
Instead of deleting whole line, it deletes from cursor position, and takes leading indentation into account.
Relates to VSCodeVim#2804
@mrwest808
Copy link
Author

I just located the help text for <C-u> in Vim:

                                                        c_CTRL-U
CTRL-U          Remove all characters between the cursor position and
                the beginning of the line.  Previous versions of vim
                deleted all characters on the line.  If that is the
                preferred behavior, add the following to your .vimrc:
                        :cnoremap <C-U> <C-E><C-U>

Turns out that previous versions (I'm on 8.1) actually deleted the whole line, so I guess you could argue that this is more of a FEATURE REQUEST.

Either way, it would probably be preferable to update behavior to the current standard?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants