Skip to content

Commit

Permalink
Ignore buffers with weird 'buftype'
Browse files Browse the repository at this point in the history
  • Loading branch information
tpope committed Mar 23, 2022
1 parent 04b2ecf commit 2cff7ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin/endwise.vim
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ augroup endwise " {{{1
augroup END " }}}1

function! s:abbrev() abort
if get(g:, 'endwise_abbreviations', 0)
if get(g:, 'endwise_abbreviations', 0) && &buftype =~# '^\%(nowrite\|acwrite\)\=$'
for word in split(get(b:, 'endwise_words', ''), ',')
execute 'iabbrev <buffer><script>' word word.'<CR><SID>(endwise-append)<Space><C-U><BS>'
endfor
Expand Down Expand Up @@ -143,7 +143,7 @@ endfunction

function! s:crend(always) abort
let n = ""
if !exists("b:endwise_addition") || !exists("b:endwise_words") || !exists("b:endwise_syngroups")
if &buftype !~# '^\%(nowrite\|acwrite\)\=$' || !exists("b:endwise_addition") || !exists("b:endwise_words") || !exists("b:endwise_syngroups")
return n
endif
let synids = join(map(split(b:endwise_syngroups, ','), 'hlID(v:val)'), ',')
Expand Down

0 comments on commit 2cff7ed

Please sign in to comment.