Skip to content

Commit e82be74

Browse files
committed
Fix TableFormat for indented tables, version 2
Improved version of 6fe1a10 that doesn't get fooled by colons.
1 parent d7038a6 commit e82be74

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ftplugin/markdown.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ function! s:TableFormat()
550550
" Move colons for alignment to left or right side of the cell.
551551
execute 's/:\( \+\)|/\1:|/e' . l:flags
552552
execute 's/|\( \+\):/|:\1/e' . l:flags
553-
execute 's/ /-/' . l:flags
553+
execute 's/|:\?\zs[ -]\+\ze:\?|/\=repeat("-", len(submatch(0)))/' . l:flags
554554
call setpos('.', l:pos)
555555
endfunction
556556

0 commit comments

Comments
 (0)