Skip to content
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

Adds support for changing conoline setting when background setting changes #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions autoload/conoline.vim
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function! conoline#disable() abort
autocmd! conoline_only_active_window
autocmd! conoline_color_insert
autocmd! conoline_color_enable
autocmd! conoline_monitor_background_setting
let s:enabled = 0
endfunction

Expand Down Expand Up @@ -82,6 +83,12 @@ function! conoline#enable() abort
autocmd Syntax,ColorScheme * call conoline#enable()
augroup END

" Change light/dark when the background changes
augroup conoline_monitor_background_setting
autocmd!
autocmd OptionSet background :if &background == 'light' | execute "ConoLineColorLight" | else | execute "ConoLineColorDark" | endif
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can drop the executes and just write the ConoLineColor* command names directly. :neckbeard:

augroup END

setlocal cursorline
call s:normal()
let s:enabled = 1
Expand Down