t9md / atom-vim-mode-plus

vim-mode improved
https://atom.io/packages/vim-mode-plus
MIT License
1.4k stars 112 forks source link

VMP leaves indent spaces after exit to normal mode #925

Open Riddlerrr opened 7 years ago

Riddlerrr commented 7 years ago

In original vim when we add new line by o, they auto indent. But if we exit to normal mode spaces are deleted and vim leave empty new line.

vim-mode-plus adds spaces (auto indent), but after we exit to normal mode spaces are remain.

Example: Before 2017-10-20 10 14 58

After o <esc> 2017-10-20 10 15 16

t9md commented 7 years ago

I don't think this incompatibility is big issue. And I want to think when I type o that it insert new line + some indent. So o itself do insertion muatation. So cancellation is too much special treatment.

Anyway priority to FIX this is very low. And thanks to whitespace, these white space only lines are auto-removed on save.

lacostenycoder commented 6 years ago

I'd like to bump this up if it's related, or if not, LMK and I'll open new issue.

Going into INSERT mode inside an empty method, tab key inserts extra tab. I have tabs set to 2 spaces. When I use o or O it will auto-indent properly. But if I go into insert mode at beginning of a blank line and hit tab, it tabs 2x and then I have to backspace to get rid of the extra tab.

Define empty method, then set normal mode, leaves cursor where it was, this is ok.

screen shot 2018-08-31 at 4 59 14 am

Use O to insert above, works as expected: screen shot 2018-08-31 at 5 01 04 am

But if I exit insert mode, I'm left with an empty line, and empty tab is removed by whitespace package. If I then go back into insert mode instead of undo, then hit tab, I get double indentation and I then have to backspace to get cursor in correct position before typing my code:

screen shot 2018-08-31 at 5 03 04 am

This may seem like a small bug, but it has been quite annoying lately as I go in and out of insert mode often. Any fix to this bug would be greatly appreciated, thanks!