mirror of
https://github.com/dhruvasagar/vim-table-mode.git
synced 2025-11-10 03:53:48 -05:00
Fix the column modifications on escaped separators
If a g:table_mode_separator is escaped by a backslash, the table is aligned ignoring this instance of the g:table_mode_separator, but the column deletion and insertion functions did not consider this behaviour. The g:table_mode_escaped_separator regex is simplified and optimized a little bit. Also more care is taken to prevent unexpected behaviour if special characters are used as g:table_mode_separator.
This commit is contained in:
@@ -60,3 +60,7 @@ function tablemode#utils#MoveToLine(line) "{{{2
|
||||
execute "normal! ".(-offset)."k"
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! tablemode#utils#SeparatorCount(str)
|
||||
return tablemode#utils#strlen(substitute(a:str, '\V\C\(\\' . escape(g:table_mode_separator, '\') . '\|\[^' . escape(g:table_mode_separator, ']^-\') . ']\)', '', 'g'))
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user