mirror of
https://github.com/BourgeoisBear/clrzr.git
synced 2026-09-10 07:16:27 -04:00
Less obnoxious warning style when necessary Vim features are missing.
This commit is contained in:
parent
a978dcfa6e
commit
bb61373c80
|
|
@ -24,6 +24,9 @@ BEGIN {
|
|||
{
|
||||
szLine = tolower($1)
|
||||
|
||||
# --characters-as-bytes / -b ?
|
||||
# --posix
|
||||
|
||||
# PREFIX: buf_no \t line_no \t lines_total \t
|
||||
|
||||
# BUF#
|
||||
|
|
|
|||
|
|
@ -299,12 +299,19 @@ endfunction
|
|||
|
||||
|
||||
function! s:RemoveProps(n_buf, l_first, l_last)
|
||||
|
||||
" ENSURE THAT BUFFER STILL EXISTS
|
||||
let l_info = getbufinfo(a:n_buf)
|
||||
if empty(l_info) | return 0 | endif
|
||||
|
||||
" REMOVE TEXTPROPS FROM LINES l_first TO l_last
|
||||
let firstlast = sort([a:l_first, a:l_last], 'f')
|
||||
return prop_remove({
|
||||
\ 'bufnr': a:n_buf,
|
||||
\ 'id': 777,
|
||||
\ 'all': 1,
|
||||
\ }, firstlast[0], firstlast[1])
|
||||
|
||||
endfunction
|
||||
|
||||
" BUILDS TEXTPROPS (COLORS+PATTERNS) FOR THE CURRENT BUFFER
|
||||
|
|
|
|||
|
|
@ -14,19 +14,19 @@
|
|||
if exists("loaded_clrzr") | finish | endif
|
||||
|
||||
if !has('textprop')
|
||||
echoerr 'clrzr disabled: +textprop Vim feature not found'
|
||||
autocmd VimEnter * echo 'clrzr disabled: +textprop Vim feature not found'
|
||||
finish
|
||||
endif
|
||||
|
||||
if !has('gui_running')
|
||||
if !(has('termguicolors') && &termguicolors)
|
||||
echoerr 'clrzr disabled: termguicolors not enabled and/or available'
|
||||
autocmd VimEnter * echo 'clrzr disabled: termguicolors not enabled and/or available'
|
||||
finish
|
||||
endif
|
||||
endif
|
||||
|
||||
if !exists('##TextChanged')
|
||||
echoerr 'clrzr disabled: TextChanged autocmd not found'
|
||||
autocmd VimEnter * echo 'clrzr disabled: TextChanged autocmd not found'
|
||||
finish
|
||||
endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue