GTabularize tweaks

This commit is contained in:
Matt Wozniski 2012-09-11 00:33:47 -04:00
parent df28fbc369
commit dadab80e82
2 changed files with 4 additions and 7 deletions

View File

@ -256,7 +256,7 @@ function! tabular#TabularizeStrings(strings, delim, ...)
let line = lines[idx]
if len(line) == 1 && s:do_gtabularize
let lines[idx] = line[0] " GTabularize just ignores non-matching lines
let lines[idx] = line[0] " GTabularize doesn't change non-matching lines
continue
endif
@ -312,7 +312,7 @@ function! tabular#PipeRangeWithOptions(includepat, filterlist, options) range
let top = a:firstline
let bot = a:lastline
let s:do_gtabularize = (a:options['mode'] ==# 'GTabularize')
let s:do_gtabularize = (get(a:options, 'mode', '') ==# 'GTabularize')
if !s:do_gtabularize
" In the default mode, apply range extension logic

View File

@ -264,14 +264,11 @@ com! -nargs=* -range -complete=customlist,<SID>CompleteTabularizeCommand
\ Tabularize <line1>,<line2>call Tabularize(<q-args>)
function! Tabularize(command, ...) range
let piperange_opt = {}
if a:0
let options = a:1
else
let options = {}
let piperange_opt = a:1
endif
let piperange_opt = { 'mode': get(options, 'mode', '') }
if empty(a:command)
if !exists("s:last_tabularize_command")
echohl ErrorMsg