aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Christian Pohle2021-05-16 18:15:19 +0200
committerMax Christian Pohle2021-05-16 18:15:19 +0200
commitc2a2e796c7262d4473add7ac637e13d17a1561ec (patch)
tree4d60f5f141e454c01fc18fc1471dc3885c18cbaf
parente7946e3846a5c8f5703df89bdfe493636caceeda (diff)
downloadvim-fancy-line-c2a2e796c7262d4473add7ac637e13d17a1561ec.tar.bz2
vim-fancy-line-c2a2e796c7262d4473add7ac637e13d17a1561ec.zip
Fixed color scheme bug and added screenshot
-rw-r--r--README.md2
-rwxr-xr-xplugin/vim-fancy-line.vim30
-rw-r--r--screenshot.pngbin0 -> 157675 bytes
3 files changed, 16 insertions, 16 deletions
diff --git a/README.md b/README.md
index d808107..fb0b8c1 100644
--- a/README.md
+++ b/README.md
@@ -9,6 +9,8 @@ look similar to powerline, but that is no wonder, because the `` symbol
9is the only one, which used to be available in code page 437 and thus broadly 9is the only one, which used to be available in code page 437 and thus broadly
10compatible. 10compatible.
11 11
12![screenshot](/screenshot.png)
13
12## Installation 14## Installation
13 15
14This should be sufficient: 16This should be sufficient:
diff --git a/plugin/vim-fancy-line.vim b/plugin/vim-fancy-line.vim
index 8e470ff..410912d 100755
--- a/plugin/vim-fancy-line.vim
+++ b/plugin/vim-fancy-line.vim
@@ -5,7 +5,7 @@ augroup MAX_FANCYLINE
5 set laststatus=2 | " required by AirLine and Lightline, without status line does not appear until a window split 5 set laststatus=2 | " required by AirLine and Lightline, without status line does not appear until a window split
6 6
7 7
8 if (&term ==? 'linux' && &termguicolors == 0) 8 if (&term ==? 'linux')
9 let g:group_active = 'StatusLineTerm' 9 let g:group_active = 'StatusLineTerm'
10 let g:group_inactive = 'StatusLineTermNC' 10 let g:group_inactive = 'StatusLineTermNC'
11 let g:group_tabline = 'TabLine' 11 let g:group_tabline = 'TabLine'
@@ -31,25 +31,23 @@ augroup MAX_FANCYLINE
31 " this function reverts foreground color and background color of a given 31 " this function reverts foreground color and background color of a given
32 " highlight group and returns the name of a newly created _invert group 32 " highlight group and returns the name of a newly created _invert group
33 function! CreateInvertGroup(highlight_group) 33 function! CreateInvertGroup(highlight_group)
34 let w:gui_bg=synIDattr(synIDtrans(hlID(a:highlight_group)), 'bg', 'gui')
35 let w:gui_fg=synIDattr(synIDtrans(hlID(a:highlight_group)), 'fg', 'gui')
36 let w:cterm_bg=synIDattr(synIDtrans(hlID(a:highlight_group)), 'bg', 'cterm')
37 let w:cterm_fg=synIDattr(synIDtrans(hlID(a:highlight_group)), 'fg', 'cterm')
34 38
35 if(synIDattr(synIDtrans(hlID(a:highlight_group)), 'reverse')==0) 39 if(w:gui_bg ==# '') | let w:gui_bg = 'NONE' | endif
36 let w:color=synIDattr(hlID(a:highlight_group), 'bg#') 40 if(w:gui_fg ==# '') | let w:gui_fg = 'NONE' | endif
37 let w:termcolor=synIDattr(hlID(a:highlight_group), 'bg') 41 if(w:cterm_bg ==# '') | let w:cterm_bg = 'NONE' | endif
38 else 42 if(w:cterm_fg ==# '') | let w:cterm_fg = 'NONE' | endif
39 let w:color=synIDattr(hlID(a:highlight_group), 'fg#')
40 let w:termcolor=synIDattr(hlID(a:highlight_group), 'fg')
41 endif
42 43
43 let l:retval=a:highlight_group.'_invert' 44 let l:retval=a:highlight_group.'_invert'
44 if(exists('w:color') && w:color ==# '')
45 let w:color = 'NONE'
46 endif
47 if(exists('w:termcolor') && w:termcolor ==# '')
48 let w:termcolor = 'NONE'
49 endif
50 45
51 silent! exec 'highlight! '.l:retval.' guifg='.w:color 46 if(1 == synIDattr(synIDtrans(hlID(a:highlight_group)), 'reverse'))
52 silent! exec 'highlight! '.l:retval.' ctermfg='.w:termcolor 47 exec 'highlight! default '.l:retval.' ctermfg='.w:cterm_fg.' ctermbg=NONE'.' guifg='.w:gui_fg.' guibg=NONE'
48 else
49 exec 'highlight! default '.l:retval.' ctermfg='.w:cterm_bg.' ctermbg=NONE'.' guifg='.w:gui_bg.' guibg=NONE'
50 endif
53 51
54 return l:retval 52 return l:retval
55 endfunction 53 endfunction
diff --git a/screenshot.png b/screenshot.png
new file mode 100644
index 0000000..c99217b
--- /dev/null
+++ b/screenshot.png
Binary files differ
..