mirror of
				https://github.com/vim/vim.git
				synced 2025-10-30 09:47:20 -04:00 
			
		
		
		
	patch 9.0.1659: Termdebug: default highlight cleared if changing colorscheme
Problem: Termdebug: default highlight cleared when changing colorscheme. Solution: Use a ColorScheme autocommand. (Christian Brabandt, closes #12566, closes #12555)
This commit is contained in:
		
				
					committed by
					
						 Bram Moolenaar
						Bram Moolenaar
					
				
			
			
				
	
			
			
			
						parent
						
							c8b6d4b378
						
					
				
				
					commit
					279de0cd1f
				
			| @@ -2,7 +2,7 @@ | |||||||
| " | " | ||||||
| " Author: Bram Moolenaar | " Author: Bram Moolenaar | ||||||
| " Copyright: Vim license applies, see ":help license" | " Copyright: Vim license applies, see ":help license" | ||||||
| " Last Change: 2022 Nov 10 | " Last Change: 2023 Jun 24 | ||||||
| " | " | ||||||
| " WORK IN PROGRESS - The basics works stable, more to come | " WORK IN PROGRESS - The basics works stable, more to come | ||||||
| " Note: In general you need at least GDB 7.12 because this provides the | " Note: In general you need at least GDB 7.12 because this provides the | ||||||
| @@ -81,6 +81,8 @@ func s:Breakpoint2SignNumber(id, subid) | |||||||
|   return s:break_id + a:id * 1000 + a:subid |   return s:break_id + a:id * 1000 + a:subid | ||||||
| endfunction | endfunction | ||||||
|  |  | ||||||
|  | " Define or adjust the default highlighting, using background "new". | ||||||
|  | " When the 'background' option is set then "old" has the old value. | ||||||
| func s:Highlight(init, old, new) | func s:Highlight(init, old, new) | ||||||
|   let default = a:init ? 'default ' : '' |   let default = a:init ? 'default ' : '' | ||||||
|   if a:new ==# 'light' && a:old !=# 'light' |   if a:new ==# 'light' && a:old !=# 'light' | ||||||
| @@ -90,9 +92,21 @@ func s:Highlight(init, old, new) | |||||||
|   endif |   endif | ||||||
| endfunc | endfunc | ||||||
|  |  | ||||||
| call s:Highlight(1, '', &background) | " Define the default highlighting, using the current 'background' value. | ||||||
| hi default debugBreakpoint term=reverse ctermbg=red guibg=red | func s:InitHighlight() | ||||||
| hi default debugBreakpointDisabled term=reverse ctermbg=gray guibg=gray |   call s:Highlight(1, '', &background) | ||||||
|  |   hi default debugBreakpoint term=reverse ctermbg=red guibg=red | ||||||
|  |   hi default debugBreakpointDisabled term=reverse ctermbg=gray guibg=gray | ||||||
|  | endfunc | ||||||
|  |  | ||||||
|  | " Setup an autocommand to redefine the default highlight when the colorscheme | ||||||
|  | " is changed. | ||||||
|  | func s:InitAutocmd() | ||||||
|  |   augroup TermDebug | ||||||
|  |     autocmd! | ||||||
|  |     autocmd ColorScheme * call s:InitHighlight() | ||||||
|  |   augroup END | ||||||
|  | endfunc | ||||||
|  |  | ||||||
| " Get the command to execute the debugger as a list, defaults to ["gdb"]. | " Get the command to execute the debugger as a list, defaults to ["gdb"]. | ||||||
| func s:GetCommand() | func s:GetCommand() | ||||||
| @@ -1522,5 +1536,8 @@ func s:BufUnloaded() | |||||||
|   endfor |   endfor | ||||||
| endfunc | endfunc | ||||||
|  |  | ||||||
|  | call s:InitHighlight() | ||||||
|  | call s:InitAutocmd() | ||||||
|  |  | ||||||
| let &cpo = s:keepcpo | let &cpo = s:keepcpo | ||||||
| unlet s:keepcpo | unlet s:keepcpo | ||||||
|   | |||||||
| @@ -695,6 +695,8 @@ static char *(features[]) = | |||||||
|  |  | ||||||
| static int included_patches[] = | static int included_patches[] = | ||||||
| {   /* Add new patch number below this line */ | {   /* Add new patch number below this line */ | ||||||
|  | /**/ | ||||||
|  |     1659, | ||||||
| /**/ | /**/ | ||||||
|     1658, |     1658, | ||||||
| /**/ | /**/ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user