]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Fix comments for TableFormat #265
authorHiroshi Shirosaki <h.shirosaki@gmail.com>
Fri, 26 Feb 2016 02:18:37 +0000 (11:18 +0900)
committerHiroshi Shirosaki <h.shirosaki@gmail.com>
Fri, 26 Feb 2016 02:18:37 +0000 (11:18 +0900)
ftplugin/markdown.vim

index 71c67357ac1ed11c6409a8984c826e3565559cd9..14c24bc390b25f0d6b1b0980deeda1c8efe4a5ab 100644 (file)
@@ -456,12 +456,14 @@ 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/\(:\@<!-:\@!\|[^|:-]\)//e' . l:flags
     execute 's/--/-/e' . l:flags
     Tabularize /|
+    " Move colons for alignment to left or right side of the cell.
     execute 's/:\( \+\)|/\1:|/e' . l:flags
     execute 's/|\( \+\):/|:\1/e' . l:flags
     execute 's/ /-/' . l:flags