File autoload/Preamble.vim changed (mode: 100644) (index 9ad871a..50afd57) |
... |
... |
fun! Preamble#Enable(filetypes) |
27 |
27 |
if a:filetypes == "" | return | endif |
if a:filetypes == "" | return | endif |
28 |
28 |
|
|
29 |
29 |
augroup AugroupPreamble |
augroup AugroupPreamble |
30 |
|
execute "au BufWinEnter " . a:filetypes . " call Preamble#Fold()" |
|
|
30 |
|
execute 'au BufWinEnter' a:filetypes 'call Preamble#Fold()' |
31 |
31 |
augroup END |
augroup END |
32 |
32 |
endfunction |
endfunction |
33 |
33 |
|
|
|
... |
... |
fun! Preamble#Fold() |
51 |
51 |
|
|
52 |
52 |
" if a fold aleady exists in line 1, just close it |
" if a fold aleady exists in line 1, just close it |
53 |
53 |
if foldlevel(1) && foldclosed(1) == -1 |
if foldlevel(1) && foldclosed(1) == -1 |
54 |
|
execute ":1,".pl."foldclose" |
|
|
54 |
|
execute ':1,'.pl.'foldclose' |
55 |
55 |
return |
return |
56 |
56 |
endif |
endif |
57 |
57 |
|
|
58 |
|
if &foldmethod=="syntax" | return | endif |
|
|
58 |
|
if &foldmethod=='syntax' | return | endif |
59 |
59 |
|
|
60 |
|
execute "set foldmethod=manual | :1,".pl."fold | :1,".pl."foldclose" |
|
|
60 |
|
execute 'set foldmethod=manual | :1,'.pl.'fold | :1,'.pl.'foldclose' |
61 |
61 |
endfunction |
endfunction |
62 |
62 |
|
|
63 |
63 |
|
|
|
... |
... |
fun! s:Length() |
179 |
179 |
if !is_blankline |
if !is_blankline |
180 |
180 |
let synId = synID(line_pos, 1, 1) |
let synId = synID(line_pos, 1, 1) |
181 |
181 |
let realSynId = synIDtrans(synId) |
let realSynId = synIDtrans(synId) |
182 |
|
if (synIDattr( realSynId, 'name' ) != "Comment") | break | endif |
|
|
182 |
|
if (synIDattr( realSynId, 'name' ) != 'Comment') | break | endif |
183 |
183 |
endif |
endif |
184 |
184 |
|
|
185 |
185 |
let line_pos = line_pos + 1 |
let line_pos = line_pos + 1 |