mirror of
https://github.com/dhruvasagar/vim-table-mode.git
synced 2025-11-09 11:33:47 -05:00
20 lines
449 B
VimL
20 lines
449 B
VimL
" Private Functions {{{1
|
|
|
|
" Public Functions {{{1
|
|
function! tablemode#utils#line(row) "{{{2
|
|
if type(a:row) == type('')
|
|
return line(a:row)
|
|
else
|
|
return a:row
|
|
endif
|
|
endfunction
|
|
|
|
function! tablemode#utils#strip(string) "{{{2
|
|
return matchstr(a:string, '^\s*\zs.\{-}\ze\s*$')
|
|
endfunction
|
|
|
|
" To count multibyte characters accurately {{{2
|
|
function! tablemode#utils#strlen(text)
|
|
return strlen(substitute(a:text, '.', 'x', 'g'))
|
|
endfunction
|