Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 8 additions & 20 deletions autoload/AnsiEsc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2111,11 +2111,8 @@ fun! s:MultiElementHandler()
continue
elseif skip == 385
" handling <esc>[38;5;...
if has("gui") && has("gui_running")
let fg= s:Ansi2Gui(code)
else
let fg= code
endif
let fg= code
let guifg= s:Ansi2Gui(code)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably you should define both new vars in function header, just like existing vars were defined.

let skip= 0
" call Decho(" 2: building code=".code." skip=".skip.": mod<".mod."> fg<".fg."> bg<".bg.">")
continue
Expand All @@ -2127,11 +2124,8 @@ fun! s:MultiElementHandler()
continue
elseif skip == 485
" handling <esc>[48;5;...
if has("gui") && has("gui_running")
let bg= s:Ansi2Gui(code)
else
let bg= code
endif
let bg= code
let guibg= s:Ansi2Gui(code)
let skip= 0
" call Decho(" 4: building code=".code." skip=".skip.": mod<".mod."> fg<".fg."> bg<".bg.">")
continue
Expand Down Expand Up @@ -2212,16 +2206,10 @@ fun! s:MultiElementHandler()

" build highlighting rule
let hirule= "hi ansiMEH".mehcnt
if has("gui") && has("gui_running")
let hirule=hirule." gui=".mod
if fg != ""| let hirule=hirule." guifg=".fg| endif
if bg != ""| let hirule=hirule." guibg=".bg| endif
else
let hirule=hirule." cterm=".mod
if fg != ""| let hirule=hirule." ctermfg=".fg| endif
if bg != ""| let hirule=hirule." ctermbg=".bg| endif
endif
" call Decho(" exe hirule: ".hirule)
let hirule=hirule." cterm=".mod." gui=".mod
if fg != ""| let hirule=hirule." ctermfg=".fg." guifg=".guifg| endif

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably it makes sense to check both (fg OR guifg is set), and same on next line.

if bg != ""| let hirule=hirule." ctermbg=".bg." guibg=".guibg| endif
"call Decho(" exe hirule: ".hirule)
exe hirule
endif

Expand Down