mirror of
https://github.com/dhruvasagar/vim-table-mode.git
synced 2025-11-10 12:03:48 -05:00
Merge pull request #134 from jeetsukumaran/master
Disable/restore foldmethod during realignment
This commit is contained in:
@@ -166,6 +166,9 @@ function! tablemode#table#AddBorder(line) "{{{2
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! tablemode#table#Realign(line) "{{{2
|
function! tablemode#table#Realign(line) "{{{2
|
||||||
|
let current_fm = &foldmethod " save foldmethod to be restored
|
||||||
|
setlocal foldmethod=manual " manual foldmethod while table is being aligned
|
||||||
|
|
||||||
let line = tablemode#utils#line(a:line)
|
let line = tablemode#utils#line(a:line)
|
||||||
|
|
||||||
let lines = []
|
let lines = []
|
||||||
@@ -200,4 +203,7 @@ function! tablemode#table#Realign(line) "{{{2
|
|||||||
for bline in blines
|
for bline in blines
|
||||||
call tablemode#table#AddBorder(bline)
|
call tablemode#table#AddBorder(bline)
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
|
" restore foldmethod
|
||||||
|
execute "setlocal foldmethod=" . current_fm
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
Reference in New Issue
Block a user