diff --git a/autoload/clrzr.awk b/autoload/clrzr.awk index 754b5ea..31a1fe7 100644 --- a/autoload/clrzr.awk +++ b/autoload/clrzr.awk @@ -24,6 +24,9 @@ BEGIN { { szLine = tolower($1) + # --characters-as-bytes / -b ? + # --posix + # PREFIX: buf_no \t line_no \t lines_total \t # BUF# diff --git a/autoload/clrzr.vim b/autoload/clrzr.vim index 70c21fb..569a536 100644 --- a/autoload/clrzr.vim +++ b/autoload/clrzr.vim @@ -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 diff --git a/plugin/clrzr.vim b/plugin/clrzr.vim index 05a01d8..c25c0a4 100644 --- a/plugin/clrzr.vim +++ b/plugin/clrzr.vim @@ -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