Only insert borders on blank/whitespace-only lines

Fixes #45.

Require our end expr to insert a border. This prevents borders from
clobbering other text and makes it possible to use visual block to insert
a new column.
This commit is contained in:
David Briscoe
2018-05-19 06:15:36 -07:00
parent 5483e163bd
commit cf11264525

View File

@@ -170,7 +170,7 @@ endfunction
function! tablemode#TableizeInsertMode() "{{{2
if tablemode#IsActive()
if getline('.') =~# (tablemode#table#StartExpr() . g:table_mode_separator . g:table_mode_separator)
if getline('.') =~# (tablemode#table#StartExpr() . g:table_mode_separator . g:table_mode_separator) . tablemode#table#EndExpr()
call tablemode#table#AddBorder('.')
normal! A
elseif getline('.') =~# (tablemode#table#StartExpr() . g:table_mode_separator)