Fix a bug dumping colors not set in the scheme
CSApproxSnapshot should make a snapshot of the currently used colors, rather than the colors defined in the colorscheme. But, when CSApproxSnapshot() changed &t_Co, the scheme was reloaded, causing :hi clear to run and delete all colors. Definitely not desired. Stop that from happening in the same way as it is prevented in CSApprox().
This commit is contained in:
parent
25191dfdf4
commit
4091aca090
@ -759,6 +759,18 @@ function! s:CSApproxSnapshot(file, overwrite)
|
|||||||
let save_CSApprox_eterm = g:CSApprox_eterm
|
let save_CSApprox_eterm = g:CSApprox_eterm
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Needed just like in CSApprox()
|
||||||
|
if exists("g:colors_name")
|
||||||
|
let colors_name = g:colors_name
|
||||||
|
unlet g:colors_name
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Needed just like in CSApprox()
|
||||||
|
if exists("g:syntax_cmd")
|
||||||
|
let syntax_cmd = g:syntax_cmd
|
||||||
|
endif
|
||||||
|
let g:syntax_cmd = "PLEASE DON'T CHANGE ANY COLORS!!!"
|
||||||
|
|
||||||
try
|
try
|
||||||
let lines = []
|
let lines = []
|
||||||
let lines += [ '" This scheme was created by CSApproxSnapshot' ]
|
let lines += [ '" This scheme was created by CSApproxSnapshot' ]
|
||||||
@ -841,6 +853,15 @@ function! s:CSApproxSnapshot(file, overwrite)
|
|||||||
if exists("save_CSApprox_eterm")
|
if exists("save_CSApprox_eterm")
|
||||||
let g:CSApprox_eterm = save_CSApprox_eterm
|
let g:CSApprox_eterm = save_CSApprox_eterm
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if exists("colors_name")
|
||||||
|
let g:colors_name = colors_name
|
||||||
|
endif
|
||||||
|
|
||||||
|
unlet g:syntax_cmd
|
||||||
|
if exists("syntax_cmd")
|
||||||
|
let g:syntax_cmd = syntax_cmd
|
||||||
|
endif
|
||||||
endtry
|
endtry
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user