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

fix: highlighting is lost when colorscheme is changed #53

Merged
merged 2 commits into from
Dec 16, 2020
Merged

fix: highlighting is lost when colorscheme is changed #53

merged 2 commits into from
Dec 16, 2020

Conversation

habamax
Copy link
Contributor

@habamax habamax commented Dec 16, 2020

New vim restores default highlight links, but fails to do it when there is no default link in the first place.

Without this fix, vim-exchange looses highlighting after :colorscheme ...

Relates to vim/vim#6970

New vim restores default highlight links, but fails to do it when there is no default link in the first place.

Without this fix, vim-exchange looses highlighting after `:colorscheme ...`

Relates to vim/vim#6970
@tommcdo
Copy link
Owner

tommcdo commented Dec 16, 2020

Did you verify that this fixes the issue? It seems that the line you're adding is already being called at startup:

command! -bar XchangeHighlightToggle call s:highlight_toggle()
command! -bar XchangeHighlightEnable call s:highlight_toggle(1)
command! -bar XchangeHighlightDisable call s:highlight_toggle(0)
XchangeHighlightEnable

function! s:highlight_toggle(...)
if a:0 == 1
let s:enable_highlighting = a:1
else
let s:enable_highlighting = !s:enable_highlighting
endif
execute 'highlight link _exchange_region' (s:enable_highlighting ? 'ExchangeRegion' : 'None')
endfunction

@habamax
Copy link
Contributor Author

habamax commented Dec 16, 2020

Sure I did.

Note default added.

@tommcdo
Copy link
Owner

tommcdo commented Dec 16, 2020

Yep, I see it now

plugin/exchange.vim Outdated Show resolved Hide resolved
Co-authored-by: Tom McDonald <tommcdo@gmail.com>
@tommcdo tommcdo merged commit 17f1a2c into tommcdo:master Dec 16, 2020
@tommcdo
Copy link
Owner

tommcdo commented Dec 16, 2020

Thanks!

jchros added a commit to jchros/vim-exchange that referenced this pull request Dec 20, 2020
This reverts commit 17f1a2c, reversing
changes made to 13d3895.
jchros added a commit to jchros/vim-exchange that referenced this pull request Dec 20, 2020
This reverts commit 17f1a2c, reversing
changes made to 13d3895.
jchros added a commit to jchros/vim-exchange that referenced this pull request Dec 20, 2020
This reverts commit 17f1a2c, reversing
changes made to 13d3895.
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 this pull request may close these issues.

None yet

2 participants