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-b> on blank line also deletes last character of previous line #60

Open
MithicSpirit opened this issue Apr 23, 2024 · 0 comments
Open

Comments

@MithicSpirit
Copy link

Doing <C-b> on a blank line (either empty or at the end of one with only whitespace) causes the line to be deleted (expected) and the last character of the previous line to be deleted as well (unexpected). For example, in the following code, pressing <C-b> results in just ba| (the | represents the cursor, rather than any character).

bar
|

Looking at the code, I believe that the culprit is the s at the end, and I think that replacing it with an a will fix the issue.

inoremap <expr> <C-B> getline('.')=~'^\s*$'&&col('.')>strlen(getline('.'))?"0\<Lt>C-D>\<Lt>Esc>kJs":"\<Lt>Left>"

As a side note, why is 0<C-d> run? I thought J already removed the indentation.

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

No branches or pull requests

1 participant