Skip to content

Commit

Permalink
patch 8.1.0081: the terminal debugger doesn't adjust to changed 'back…
Browse files Browse the repository at this point in the history
…ground'

Problem:    The terminal debugger doesn't adjust to changed 'background'.
Solution:   Add an OptionSet autocommand. (Christian Brabandt)
  • Loading branch information
brammool committed Jun 19, 2018
1 parent de1a831 commit f07f9e7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 11 additions & 6 deletions runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
Expand Up @@ -70,11 +70,16 @@ let s:pc_id = 12
let s:break_id = 13 " breakpoint number is added to this
let s:stopped = 1

if &background == 'light'
hi default debugPC term=reverse ctermbg=lightblue guibg=lightblue
else
hi default debugPC term=reverse ctermbg=darkblue guibg=darkblue
endif
func s:Highlight(init, old, new)
let default = a:init ? 'default ' : ''
if a:new ==# 'light' && a:old !=# 'light'
exe "hi " . default . "debugPC term=reverse ctermbg=lightblue guibg=lightblue"
elseif a:new ==# 'dark' && a:old !=# 'dark'
exe "hi " . default . "debugPC term=reverse ctermbg=darkblue guibg=darkblue"
endif
endfunc

call s:Highlight(1, '', &background)
hi default debugBreakpoint term=reverse ctermbg=red guibg=red

func s:StartDebug(bang, ...)
Expand Down Expand Up @@ -347,6 +352,7 @@ func s:StartDebugCommon(dict)
augroup TermDebug
au BufRead * call s:BufRead()
au BufUnload * call s:BufUnloaded()
au OptionSet background call s:Highlight(0, v:option_old, v:option_new)
augroup END

" Run the command if the bang attribute was given and got to the debug
Expand Down Expand Up @@ -887,4 +893,3 @@ func s:BufUnloaded()
endif
endfor
endfunc

2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -761,6 +761,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
81,
/**/
80,
/**/
Expand Down

0 comments on commit f07f9e7

Please sign in to comment.