diff --git a/after/plugin/table-mode.vim b/after/plugin/table-mode.vim index ecf16d4..e65379b 100644 --- a/after/plugin/table-mode.vim +++ b/after/plugin/table-mode.vim @@ -20,10 +20,10 @@ " ============================================================================= " Finish if already loaded {{{1 -if exists('g:table_mode_loaded') +if exists('g:loaded_table_mode') finish endif -let g:table_mode_loaded = 1 +let g:loaded_table_mode = 1 "}}}1 " " Finish if Tabularize plugin is not available {{{1 @@ -152,4 +152,4 @@ let &cpo = s:save_cpo " }}}1 " ModeLine {{{ -" vim:fdl=0 fdm=marker +" vim: sw=2 sts=2 fdl=0 fdm=marker diff --git a/autoload/tablemode.vim b/autoload/tablemode.vim index 513d1ab..92c8f97 100644 --- a/autoload/tablemode.vim +++ b/autoload/tablemode.vim @@ -20,6 +20,12 @@ " Private Functions {{{1 +if exists('g:autoloaded_table_mode') "{{{2 + finish +endif +let g:autoloaded_table_mode = 1 +" }}}2 + " Utility Functions {{{2 function! s:throw(string) abort "{{{3 @@ -525,7 +531,7 @@ function! s:Align(lines) "{{{3 for line in lines if len(line) <= 1 | continue | endif - if line[0] !~ '^\s*$' + if line[0] !~ s:StartExpr() let line[0] = s:StripTrailingSpaces(line[0]) endif if len(line) >= 2 @@ -659,7 +665,6 @@ function! tablemode#TableRealign(line) "{{{2 let tline = tline + s:RowGap() endwhile - " call tabular#TabularizeStrings(lines, g:table_mode_separator, g:table_mode_align) let lines = s:Align(lines) for lnum in lnums @@ -864,3 +869,5 @@ endfunction " }}}2 " }}}1 + +" vim: sw=2 sts=2 fdl=0 fdm=marker