goolord / alpha-nvim

a lua powered greeter like vim-startify / dashboard-nvim
MIT License
1.84k stars 109 forks source link

Looks bad when whitespace is highlighted at the end of the line #111

Closed tareqsiraj closed 1 year ago

tareqsiraj commented 2 years ago

I have whitespace highlighted at the end of the line by default, but it looks bad when the dashboard shows up.

" Vim script I use to enable the highlighting
highlight WhitespaceEOL ctermbg=DarkYellow guibg=DarkYellow
match WhitespaceEOL /\s\+$/
au BufWinEnter * match WhitespaceEOL /\s\+$/
au InsertEnter * match WhitespaceEOL /\s\+\%#\@<!$/
au InsertLeave * match WhitespaceEOL /\s\+$/
au BufWinLeave * call clearmatches()
let b:show_whitespace = 1

Screenshot from 2022-05-19 23-25-54

drselump14 commented 1 year ago

Any fix for this issue?

YodaEmbedding commented 1 year ago

Solutions:

  1. Eliminate the trailing whitespace.
  2. Some autocmd that runs on alpha-nvim enter / exit. Then, just set the highlight group to guibg=NONE on enter, and restore it when exiting.
goolord commented 1 year ago

fixed in https://github.com/goolord/alpha-nvim/commit/f945f1294f97d2acf6bee085d47bfbbb5a8e3e72

i had mostly ignored this since you could easily solve this problem by setting let b:show_whitespace = 1 or whatever in your alpha setup, but i don't think anyone is going to ever want the right-margin to be filled in, anyways