Skip to content

Highlight failure #128

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

Closed
onlycalm opened this issue Mar 23, 2020 · 9 comments · Fixed by #129
Closed

Highlight failure #128

onlycalm opened this issue Mar 23, 2020 · 9 comments · Fixed by #129

Comments

@onlycalm
Copy link

When blank character highlighting is set, if floating window appears, the highlighting will be invalid, and it will not be restored until entering the insertion mode again.

@Cimbali
Copy link
Collaborator

Cimbali commented Mar 23, 2020

Hi @Calm-cpy, thanks for reporting this issue.

Could you specify what you mean by floating window? Is this a vim popup buffer or a neovim buffer? Can you also give an example of what you do to open the floating window?

@onlycalm
Copy link
Author

Didn't reply in time due to time difference. It's vim popup.
About floating window:
2020-03-24_9-14-20
"error" is an illegal character. I put two spaces after "error". When the cursor moves to error, my language check plug-in will pop up float windows to display the error message. When pop up the float window, all highlights will fail.
2020-03-24_9-13-19
After re entering the insertion mode, the blank character will be highlighted again.
My configuration is as follows:
let g:better_whitespace_enabled=1
let g:strip_whitespace_on_save=0
let g:current_line_whitespace_disabled_hard=0

If the configuration is modified as follows, the highlighting of the blank string will be restored automatically. But there are other problems.
let g:better_whitespace_enabled=1
let g:strip_whitespace_on_save=0
let g:current_line_whitespace_disabled_soft=1
8~BPBWIZD(BCH5VBLR6T2}O

Thank you for your attention

@onlycalm
Copy link
Author

Just tested, the gray highlight in the third figure is the problem of syntax error checking plug-in. It's not about VIM better whitespace

@Cimbali
Copy link
Collaborator

Cimbali commented Mar 24, 2020

Which plugin do you use for language errors?

@onlycalm
Copy link
Author

dense-analysis/ale

@Cimbali
Copy link
Collaborator

Cimbali commented Mar 24, 2020

Alright, I seem to be able to reproduce this on vim 8.1. The BufEnter and BufWinEnter do not get fired when the popup opens or closes.

@Cimbali
Copy link
Collaborator

Cimbali commented Mar 24, 2020

We disable the highlighting from the BufWinLeave which is called from the popup, but for the wrong buffer:

BufWinLeave			Before a buffer is removed from a window.
				Not when it's still visible in another window.
				Also triggered when exiting.  It's triggered
				before BufUnload or BufHidden.
				NOTE: When this autocommand is executed, the
				current buffer "%" may be different from the
				buffer being unloaded "<afile>".
				When exiting and v:dying is 2 or more this
				event is not triggered.

We should either check it is the correct buffer, or remove this event altogether.

Cimbali added a commit to Cimbali/vim-better-whitespace that referenced this issue Mar 24, 2020
Cimbali added a commit to Cimbali/vim-better-whitespace that referenced this issue Mar 24, 2020
ntpeters pushed a commit that referenced this issue Mar 24, 2020
* Disable in floating windows by default

* Fix highlighting disabled on popup close

Close #128
@ntpeters
Copy link
Owner

@Cimbali thanks for the quick investigation and fix for this, you rock! 😀

@Calm-cpy the fix from Cimbali is merged in now, can you update and give it a try?

@onlycalm
Copy link
Author

The problem has been fixed very well. Now I'm going to use it to enjoy programming. Thanks. 😊

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 a pull request may close this issue.

3 participants