Fixed ConvertDelimiterToSeparator

- We now aggressively add separators to a line even if it does not have
  the g:table_mode_delimiter. If the user calls Tableize, we should
  trust the user he wishes to tableize everything. Earlier
  implementation skips & fails for lines in text that did not have the
  g:table_mode_delimiter and hence formed inconsistent tables.

  Everything can be undone with a single 'u' anyways.
This commit is contained in:
Dhruva Sagar
2013-03-18 12:19:38 +05:30
parent b2ba3caf24
commit 5defaa10e4

View File

@@ -109,7 +109,7 @@ function! s:IsTableModeActive()
endfunction
function! s:ConvertDelimiterToSeparator(line)
if getline(a:line) =~# g:table_mode_delimiter
if a:line
execute 'silent! ' . a:line . 's/^\|' . g:table_mode_delimiter . '\|$/' . g:table_mode_separator . '/ge'
endif
endfunction