Refactored spreadsheet related code out of table.vim

This commit is contained in:
Dhruva Sagar
2014-04-07 12:05:20 +05:30
parent f20ff17b42
commit defd9531a7
7 changed files with 820 additions and 832 deletions

View File

@@ -1,6 +1,20 @@
" Private Functions {{{1
" Public Functions {{{1
function! tablemode#utils#sid() "{{{2
return maparg('<sid>', 'n')
endfunction
nnoremap <sid> <sid>
function! tablemode#utils#scope() "{{{2
return s:
endfunction
function! tablemode#utils#throw(string) abort "{{{2
let v:errmsg = 'table-mode: ' . a:string
throw v:errmsg
endfunction
function! tablemode#utils#line(row) "{{{2
if type(a:row) == type('')
return line(a:row)
@@ -13,7 +27,8 @@ 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 {{{2
" To count multibyte characters accurately
function! tablemode#utils#strlen(text)
return strlen(substitute(a:text, '.', 'x', 'g'))
endfunction