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

evil-maybe-remove-spaces works for evil-change-line #1487

Closed
wants to merge 2 commits into from

Conversation

roxma
Copy link
Contributor

@roxma roxma commented Jul 7, 2021

This change make cc + ESC on indented line produce the same behavior
as vim/nvim

This change make `cc` + `ESC` on indented line produce the same behavior
as vim/nvim
@@ -99,6 +99,8 @@ commands opening a new line."
evil-open-below
evil-append
evil-append-line
evil-change
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the evil-change-line addition, but not evil-change if I do c$<escape> when at the start of a line, this is an evil-change but vim doesn't remove the indentation spaces..?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • evil-change is needed for cc <escape> to remove indentation spaces
    • As a side effect, this also makes c $ <escape> remove indentation spaces
  • evil-change-line is needed for C <escape> to remove indentation spaces
    • But on my vim C <escape> does not remove the indentation spaces

I don't know how to make both cc <escape> and c $ <escape> behave the same as vim. But the minor difference is acceptable for me.

My actual need is to automatically remove trailing spaces at the cursor line when I leave insert state.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, I understand. I've noticed that vi, vim and neovim all behave differently. So evil doesn't really have a solid example to follow. I agree that c$<escape> is probably acceptable. I won't merge this without tests, so either you'll have to add them, or you'll have to wait for me to add them (sometime next week I hope).

@@ -99,6 +99,8 @@ commands opening a new line."
evil-open-below
evil-append
evil-append-line
evil-change
evil-change-line
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also be inclined to add evil-change-whole-line and any others which you notice are the same in vim.

@tomdl89
Copy link
Member

tomdl89 commented Jul 8, 2021

p.s. you can ignore the failing test in 24.5 - it's borked and we're still working on it.

@tomdl89
Copy link
Member

tomdl89 commented Jul 12, 2021

@roxma I made PR #1493 to resolve the discussed issues and add tests. Lemme know what you think

@roxma roxma closed this Jul 13, 2021
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

Successfully merging this pull request may close these issues.

None yet

2 participants