From 554c57703f6847733c6a1921b125773723c08f35 Mon Sep 17 00:00:00 2001 From: Dhruva Sagar Date: Sat, 23 Mar 2013 12:40:48 +0530 Subject: [PATCH] Minor refactoring --- autoload/tablemode.vim | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/autoload/tablemode.vim b/autoload/tablemode.vim index b2ddb59..caa5f4e 100644 --- a/autoload/tablemode.vim +++ b/autoload/tablemode.vim @@ -77,7 +77,7 @@ function! s:UpdateLineBorder(line) "{{{2 if getline(cline-1) =~# hf let prev_line_count = s:CountSeparator(cline-1, g:table_mode_corner) if curr_line_count > prev_line_count - execute 'normal! kA' . repeat(g:table_mode_corner, curr_line_count - prev_line_count) . "\j" + silent! execute 'normal! kA' . repeat(g:table_mode_corner, curr_line_count - prev_line_count) . "\j" endif else call append(cline-1, repeat(g:table_mode_corner, curr_line_count)) @@ -87,7 +87,7 @@ function! s:UpdateLineBorder(line) "{{{2 if getline(cline+1) =~# hf let next_line_count = s:CountSeparator(cline+1, g:table_mode_corner) if curr_line_count > next_line_count - execute 'normal! jA' . repeat(g:table_mode_corner, curr_line_count - next_line_count) . "\k" + silent! execute 'normal! jA' . repeat(g:table_mode_corner, curr_line_count - next_line_count) . "\k" end else call append(cline, repeat(g:table_mode_corner, curr_line_count)) @@ -96,9 +96,8 @@ endfunction " }}}2 function! s:FillTableBorder() "{{{2 - let current_col = col('.') - let current_line = line('.') - execute 'silent! %s/' . g:table_mode_corner . ' \zs\([' . + let [ current_col, current_line ] = [ col('.'), line('.') ] + silent! execute '%s/' . g:table_mode_corner . ' \zs\([' . \ g:table_mode_fillchar . ' ]*\)\ze ' . g:table_mode_corner . '/\=repeat("' . \ g:table_mode_fillchar . '", s:Strlen(submatch(0)))/g' call cursor(current_line, current_col) @@ -106,7 +105,7 @@ endfunction " }}}2 function! s:ConvertDelimiterToSeparator(line) "{{{2 - execute 'silent! ' . a:line . 's/^\s*\zs\ze.\|' . g:table_mode_delimiter . + silent! execute a:line . 's/^\s*\zs\ze.\|' . g:table_mode_delimiter . \ '\|$/' . g:table_mode_separator . '/g' endfunction " }}}2