mirror of
https://github.com/dhruvasagar/vim-table-mode.git
synced 2025-11-12 04:53:46 -05:00
Fixed s:GetCommentEnd(), s:EndCommentExpr()
Also fixed s:ConvertDelimiterToSeparator() such that it doesn't mess up the end comment and draws the border before it.
This commit is contained in:
@@ -104,7 +104,7 @@ endfunction
|
|||||||
function! s:GetCommentEnd() "{{{2
|
function! s:GetCommentEnd() "{{{2
|
||||||
let cstring = &commentstring
|
let cstring = &commentstring
|
||||||
if s:Strlen(cstring) > 0
|
if s:Strlen(cstring) > 0
|
||||||
let cst = split(cstring, '%')
|
let cst = split(cstring, '%s')
|
||||||
if len(cst) == 2
|
if len(cst) == 2
|
||||||
return substitute(cst[1], '.', '\\\0', 'g')
|
return substitute(cst[1], '.', '\\\0', 'g')
|
||||||
else
|
else
|
||||||
@@ -149,7 +149,7 @@ endfunction
|
|||||||
function! s:EndCommentExpr() "{{{2
|
function! s:EndCommentExpr() "{{{2
|
||||||
let cendexpr = s:GetCommentEnd()
|
let cendexpr = s:GetCommentEnd()
|
||||||
if s:Strlen(cendexpr) > 0
|
if s:Strlen(cendexpr) > 0
|
||||||
return '.*\zs\s*' . cendexpr . '\s*$'
|
return '.*\zs\s\+' . cendexpr . '\s*$'
|
||||||
else
|
else
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
@@ -242,7 +242,7 @@ function! s:ConvertDelimiterToSeparator(line, ...) "{{{2
|
|||||||
if delim ==# ','
|
if delim ==# ','
|
||||||
silent! execute a:line . 's/' . "[\'\"][^\'\"]*\\zs,\\ze[^\'\"]*[\'\"]/__COMMA__/g"
|
silent! execute a:line . 's/' . "[\'\"][^\'\"]*\\zs,\\ze[^\'\"]*[\'\"]/__COMMA__/g"
|
||||||
endif
|
endif
|
||||||
silent! execute a:line . 's/' . s:StartExpr() . '\zs\ze.\|' . delim . '\|$/' .
|
silent! execute a:line . 's/' . s:StartExpr() . '\zs\ze.\|' . delim . '\|.\zs\ze' . s:EndExpr() . '/' .
|
||||||
\ g:table_mode_separator . '/g'
|
\ g:table_mode_separator . '/g'
|
||||||
if delim ==# ','
|
if delim ==# ','
|
||||||
silent! execute a:line . 's/' . "[\'\"][^\'\"]*\\zs__COMMA__\\ze[^\'\"]*[\'\"]/,/g"
|
silent! execute a:line . 's/' . "[\'\"][^\'\"]*\\zs__COMMA__\\ze[^\'\"]*[\'\"]/,/g"
|
||||||
|
|||||||
Reference in New Issue
Block a user