Skip to content

Commit

Permalink
refactor: remove highlight + palette autoload
Browse files Browse the repository at this point in the history
Move autoloaded palette, highlight to color/srcery.vim.

We don't have to reference this in multiple script files, so I've moved
it back into the main colors file
  • Loading branch information
roosta committed Sep 17, 2024
1 parent 048f87c commit 8fc46b6
Show file tree
Hide file tree
Showing 3 changed files with 372 additions and 463 deletions.
342 changes: 0 additions & 342 deletions autoload/srcery.vim

This file was deleted.

46 changes: 0 additions & 46 deletions autoload/srcery/helper.vim
Original file line number Diff line number Diff line change
Expand Up @@ -22,50 +22,4 @@ function! srcery#helper#GetColor(group, ...) abort
return [ l:gui_color, l:term_color ]
endfunction

function! srcery#helper#Highlight(group, fg, ...) abort
" Arguments: group, guifg, guibg, gui, guisp

" foreground
let l:fg = a:fg

" background
if a:0 >= 1
let l:bg = a:1
else
let l:bg = g:srcery#palette.none
endif

" emphasis
if a:0 >= 2 && strlen(a:2)
let l:emstr = a:2
else
let l:emstr = 'NONE,'
endif

" special fallback
if a:0 >= 3
if g:srcery_guisp_fallback !=# 'NONE'
let fg = a:3
endif

" bg fallback mode should invert higlighting
if g:srcery_guisp_fallback ==# 'bg'
let emstr .= 'inverse,'
endif
endif

let l:histring = [ 'hi', a:group,
\ 'guifg=' . l:fg[0], 'ctermfg=' . l:fg[1],
\ 'guibg=' . l:bg[0], 'ctermbg=' . l:bg[1],
\ 'gui=' . l:emstr[:-2], 'cterm=' . l:emstr[:-2]
\ ]

" special
if a:0 >= 3
call add(l:histring, 'guisp=' . a:3[0])
endif

execute join(l:histring, ' ')
endfunction

" vim: fdm=marker ts=2 sts=2 sw=2 fdl=0:
Loading

0 comments on commit 8fc46b6

Please sign in to comment.