summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-06-19 17:27:53 +0200
committerBram Moolenaar <Bram@vim.org>2018-06-19 17:27:53 +0200
commitf07f9e731eb97bbdbd1b0b3983750589e4f557a6 (patch)
treed74b1f727816f1767bd728df1af715ac58e85cff
parentde1a83147a28d3db8f9fca415ffc8fa04218eac2 (diff)
downloadvim-f07f9e731eb97bbdbd1b0b3983750589e4f557a6.zip
patch 8.1.0081: the terminal debugger doesn't adjust to changed 'background'
Problem: The terminal debugger doesn't adjust to changed 'background'. Solution: Add an OptionSet autocommand. (Christian Brabandt)
-rw-r--r--runtime/pack/dist/opt/termdebug/plugin/termdebug.vim17
-rw-r--r--src/version.c2
2 files changed, 13 insertions, 6 deletions
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
index f4a4dc224..9b931d143 100644
--- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
+++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
@@ -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, ...)
@@ -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
@@ -887,4 +893,3 @@ func s:BufUnloaded()
endif
endfor
endfunc
-
diff --git a/src/version.c b/src/version.c
index ebcc4efc7..39b317f2c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -762,6 +762,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 81,
+/**/
80,
/**/
79,