Skip to content
This repository has been archived by the owner on Jul 29, 2023. It is now read-only.

BUG: Does not work with a transparent background color but I think I figured out why #370

Open
leftbones opened this issue Apr 1, 2022 · 3 comments

Comments

@leftbones
Copy link

After installing I wasn't able to get the lines to show up by setting

let g:indentLine_defaultGroup = 'Comment'
let g:indentLine_char = '|'

in my .vimrc

I'm on a Mac, but I verified with grep that my installation of vim (brew) has conceal, and running hi conceal outputs Conceal xxx ctermfg=59 guifg=#5C6370

I use a custom color scheme, so I decided to try onedark since it's well supported, and suddenly the lines appeared again. Then, after applying the code to make the background color transparent for onedark, the lines disappeared again.

This is the code supplied on the onedark repo, added before colorscheme in my .vimrc

" onedark.vim override: Don't set a background color when running in a terminal;
" just use the terminal's background color
" `gui` is the hex color code used in GUI mode/nvim true-color mode
" `cterm` is the color code used in 256-color mode
" `cterm16` is the color code used in 16-color mode
if (has("autocmd") && !has("gui_running"))
  augroup colorset
    autocmd!
    let s:white = { "gui": "#ABB2BF", "cterm": "145", "cterm16" : "7" }
    autocmd ColorScheme * call onedark#set_highlight("Normal", { "fg": s:white }) " `bg` will not be styled since there is no `bg` setting
  augroup END
endif
@leftbones leftbones changed the title Does not work with a transparent background color BUG: Does not work with a transparent background color but I figured out why Apr 1, 2022
@leftbones leftbones changed the title BUG: Does not work with a transparent background color but I figured out why BUG: Does not work with a transparent background color but I think I figured out why Apr 1, 2022
@leftbones
Copy link
Author

Changed the title because now I'm less sure about my findings being the reason why it doesn't work lol

I removed that line code block for making the background transparent and now the lines are no longer showing again, I'm really not sure what caused them to disappear again.

While screwing around with the settings on the README I was able to get it to appear once but then it stopped working again and I now can't remember what I did to make it happen, so I'm retracing my steps.

@leftbones
Copy link
Author

Okay, new update. I don't know what I did to get it to reappear the previous times, BUT... I did decide to look at the rest of my .vimrc and I had this little guy here match Comment '^\s\+' which I think was just a leftover from when I was using tabs instead of spaces and making indent lines with set list lcs=tab:\|\ that never got removed. Removing that line makes the indent lines reappear again, in both Python and C files, the only ones I was testing.

@leftbones
Copy link
Author

Also confirmed that re-adding the onedark snippet I mentioned earlier (for a transparent background) still shows the indent lines in the expected color.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant