Less obnoxious warning style when necessary Vim features are missing.

This commit is contained in:
Jason Stewart 2024-12-23 23:12:34 -05:00
parent a978dcfa6e
commit bb61373c80
3 changed files with 13 additions and 3 deletions

View file

@ -24,6 +24,9 @@ BEGIN {
{
szLine = tolower($1)
# --characters-as-bytes / -b ?
# --posix
# PREFIX: buf_no \t line_no \t lines_total \t
# BUF#

View file

@ -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

View file

@ -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