mirror of
https://github.com/preservim/vim-pencil.git
synced 2025-11-16 22:03:39 -05:00
Refactor for performance
This commit is contained in:
@@ -56,10 +56,11 @@ endf
|
|||||||
fun! s:maybe_enable_autoformat()
|
fun! s:maybe_enable_autoformat()
|
||||||
" don't enable autoformat if in a code block or table
|
" don't enable autoformat if in a code block or table
|
||||||
let l:okay_to_enable = 1
|
let l:okay_to_enable = 1
|
||||||
|
let l:line = line('.')
|
||||||
let l:col = col('.')
|
let l:col = col('.')
|
||||||
" at end of line there may be no synstack, so scan back
|
" at end of line there may be no synstack, so scan back
|
||||||
while l:col > 0
|
while l:col > 0
|
||||||
let l:stack = synstack(line('.'), l:col)
|
let l:stack = synstack(l:line, l:col)
|
||||||
if l:stack != []
|
if l:stack != []
|
||||||
break
|
break
|
||||||
en
|
en
|
||||||
|
|||||||
Reference in New Issue
Block a user