Code Monkey home page Code Monkey logo

Comments (11)

nathanaelkane avatar nathanaelkane commented on May 29, 2024

Are you setting those styles after your colorscheme declaration? If you set them before they may get reset by your colorscheme.

For example in your .vimrc:
colorscheme railscasts
let g:indent_guides_auto_colors = 0
let g:indent_guides_enable_on_vim_startup = 1
hi IndentGuidesOdd guibg=#121212
hi IndentGuidesEven guibg=#262626

If that doesn't work, try this instead:
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=#121212
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=#262626

I do like the idea of adding these in as global options though, might implement that.

from vim-indent-guides.

graywh avatar graywh commented on May 29, 2024

Like I said, they are part of my colorscheme.

The problem is that your plugin clears the highlight colors when it gets loaded (line 8 of plugin/indent_guides.vim) after my vimrc has already loaded my colorscheme.

from vim-indent-guides.

graywh avatar graywh commented on May 29, 2024

See #7

from vim-indent-guides.

nathanaelkane avatar nathanaelkane commented on May 29, 2024

Ah I see, completely misread your first comment. Pull request looks reasonable, will test it out later today.

from vim-indent-guides.

nathanaelkane avatar nathanaelkane commented on May 29, 2024

This bug doesn't seem to affect MacVim for me. I don't mind the fix you've submitted, but it'd be nice if I could see the bug in action. What operating system and vim version are you using so I can try to replicate it?

from vim-indent-guides.

graywh avatar graywh commented on May 29, 2024

None of that should matter. Vim loads the vimrc before plugins. As it is, things would happen in this order:

hi IndentGuidesOdd guibg=#333333 " my colorscheme via vimrc
hi IndentGuidesOdd guibg=NONE    " autoload/indent_guides.vim via plugin/indent_guides.vim

Sure the VimEnter autocmd gets around this problem, but it's telling users "this plugin doesn't do things correctly, so here's how to hack around it" IMO.

And I've seen it in Vim 7.3 on OS X 10.6.6 and Ubuntu 10.10.

from vim-indent-guides.

nathanaelkane avatar nathanaelkane commented on May 29, 2024

No, I'm saying it works for me without the VimEnter autocmd. I put the custom highlights in my colorscheme file and it works both before and after your patch.

from vim-indent-guides.

graywh avatar graywh commented on May 29, 2024

Then your colorscheme is getting loaded after the plugin somehow (manually, autocmd).

from vim-indent-guides.

nathanaelkane avatar nathanaelkane commented on May 29, 2024

Regardless, I believe the code is an improvement, thanks for the pull request.

Just for completeness sake, can I get you to confirm that the patch works for you in Terminal Vim?

from vim-indent-guides.

graywh avatar graywh commented on May 29, 2024

It does.

And I'm guessing you set your colorscheme from gvimrc, which is loaded when the GUI starts (after plugins are loaded).

from vim-indent-guides.

nathanaelkane avatar nathanaelkane commented on May 29, 2024

Yep, that's exactly what's happening.

from vim-indent-guides.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.