From dadab80e8249f30e891663d6f75c49f436ba56d8 Mon Sep 17 00:00:00 2001 From: Matt Wozniski Date: Tue, 11 Sep 2012 00:33:47 -0400 Subject: [PATCH] GTabularize tweaks --- autoload/tabular.vim | 4 ++-- plugin/Tabular.vim | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/autoload/tabular.vim b/autoload/tabular.vim index c5afb27..385f41d 100644 --- a/autoload/tabular.vim +++ b/autoload/tabular.vim @@ -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 diff --git a/plugin/Tabular.vim b/plugin/Tabular.vim index a985319..067c1a0 100644 --- a/plugin/Tabular.vim +++ b/plugin/Tabular.vim @@ -264,14 +264,11 @@ com! -nargs=* -range -complete=customlist,CompleteTabularizeCommand \ Tabularize ,call Tabularize() 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