Refactor for performance

This commit is contained in:
Reed Esau
2014-09-17 05:32:08 -06:00
parent 0d1a0686c6
commit 93ee3e1a12

View File

@@ -56,10 +56,11 @@ endf
fun! s:maybe_enable_autoformat()
" don't enable autoformat if in a code block or table
let l:okay_to_enable = 1
let l:line = line('.')
let l:col = col('.')
" at end of line there may be no synstack, so scan back
while l:col > 0
let l:stack = synstack(line('.'), l:col)
let l:stack = synstack(l:line, l:col)
if l:stack != []
break
en