Open onlycalm opened 3 years ago
This works for me. Do you have by any chances let g:strip_only_modified_lines = 1
?
I’m replicating this behaviour by
wincmd p
So for example: vim --cmd 'au VimEnter * | vert :new | wincmd p' some_file_here
What I’m seeing is that :w
and :StripWhitespace
work fine with your specified config.
On the other hand :StripWhitespaceOnChangedLines
does nothing (as no edits have been made yet).
Thank you for your reply. I've uploaded two GIF files, which can explain the problems I'm facing. Can you check them?
If I move the cursor to another window and then move it back, the :w
instruction can remove the space.
If you need more information, please let me know. I'm afraid I didn't describe the problem clearly. Thanks
Hi @onlycalm, your screen captures seem to describe the problem well. I’m supposing some event gets missed or something but I didn’t have time to look into it yet (also I don’t have NERDTree installed)
Open file via VIM. Because neardtree can move the cursor to the window where the open file is located, the space cannot be deleted when saving the file. If you move the cursor to another window and then move back to the original window, the function will return to normal.
The configuration is as follows:
"autocmd StdinReadPre let s:std_in=1 "autocmd VimEnter NERDTree | if argc() > 0 || exists("s:std_in") | wincmd p | endif
let g:better_whitespace_enabled=1 let g:better_whitespace_ctermcolor='gray' let g:strip_whitespace_on_save=1 let g:strip_whitespace_confirm=0 let g:better_whitespace_operator='' let g:better_whitespace_blacklist=[] let g:current_line_whitespace_disabled_hard=0 let g:current_line_whitespace_disabled_soft=0