mirror of
https://github.com/dhruvasagar/vim-table-mode.git
synced 2025-11-08 11:03:47 -05:00
Attempt to Fix #173
This commit is contained in:
@@ -175,6 +175,12 @@ function! tablemode#table#AddBorder(line) "{{{2
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! tablemode#table#Realign(line) "{{{2
|
function! tablemode#table#Realign(line) "{{{2
|
||||||
|
let utree = undotree()
|
||||||
|
if utree.seq_cur != utree.seq_last
|
||||||
|
" skip during undo
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
let current_fm = &foldmethod " save foldmethod to be restored
|
let current_fm = &foldmethod " save foldmethod to be restored
|
||||||
setlocal foldmethod=manual " manual foldmethod while table is being aligned
|
setlocal foldmethod=manual " manual foldmethod while table is being aligned
|
||||||
|
|
||||||
@@ -206,11 +212,11 @@ function! tablemode#table#Realign(line) "{{{2
|
|||||||
let lines = tablemode#align#Align(lines)
|
let lines = tablemode#align#Align(lines)
|
||||||
|
|
||||||
for aline in lines
|
for aline in lines
|
||||||
call setline(aline.lnum, aline.text)
|
undojoin | keepjumps call setline(aline.lnum, aline.text)
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
for bline in blines
|
for bline in blines
|
||||||
call tablemode#table#AddBorder(bline)
|
undojoin | keepjumps call tablemode#table#AddBorder(bline)
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
" restore foldmethod
|
" restore foldmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user