X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/156e0bfe4e68b01e28aee884bf4e69a34d3e7b1a..899ef40d3c84192e3c6c0b512a40d9e42a8bb3dd:/ftplugin/markdown.vim diff --git a/ftplugin/markdown.vim b/ftplugin/markdown.vim index c7fba7f..c2fff46 100644 --- a/ftplugin/markdown.vim +++ b/ftplugin/markdown.vim @@ -357,11 +357,11 @@ function! s:Toc(...) endif endif endfor + call setloclist(0, l:header_list) if len(l:header_list) == 0 echom "Toc: No headers." return endif - call setloclist(0, l:header_list) if l:window_type ==# 'horizontal' lopen @@ -456,11 +456,16 @@ function! s:TableFormat() " Search instead of `normal! j` because of the table at beginning of file edge case. call search('|') normal! j - " Remove everything that is not a pipe othewise well formated tables would grow - " because of addition of 2 spaces on the separator line by Tabularize /|. + " Remove everything that is not a pipe, colon or hyphen next to a colon othewise + " well formated tables would grow because of addition of 2 spaces on the separator + " line by Tabularize /|. let l:flags = (&gdefault ? '' : 'g') - execute 's/[^|]//' . l:flags + execute 's/\(:\@