From 9e45c07a8d2eb77a1d276f762a448f42a33a47c6 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Wed, 14 Apr 2021 11:59:14 +0200 Subject: Update --- autoload/csv.vim | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'autoload/csv.vim') diff --git a/autoload/csv.vim b/autoload/csv.vim index e47ee41d..d268cd12 100644 --- a/autoload/csv.vim +++ b/autoload/csv.vim @@ -1989,7 +1989,6 @@ fu! csv#AnalyzeColumn(...) "{{{3 endif let title="Nr\tCount\t % \tValue" - endif echohl Title echo printf("%s", title) echohl Normal @@ -2311,7 +2310,7 @@ fu! csv#CommandDefinitions() "{{{3 call csv#LocalCmd("NewDelimiter", ':call csv#NewDelimiter(, 1, line(''$''))', \ '-nargs=1') call csv#LocalCmd("Duplicates", ':call csv#CheckDuplicates()', - \ '-nargs=1 -complete=custom,csv#CompleteColumnNr') + \ '-nargs=? -complete=custom,csv#CompleteColumnNr') call csv#LocalCmd('Transpose', ':call csv#Transpose(, )', \ '-range=%') call csv#LocalCmd('CSVTabularize', ':call csv#Tabularize(0,,)', @@ -2499,12 +2498,16 @@ fu! csv#CompleteColumnNr(A,L,P) "{{{3 return join(range(1,csv#MaxColumns()), "\n") endfu fu! csv#CheckDuplicates(list) "{{{3 - let string = a:list - if string =~ '\d\s\?-\s\?\d' - let string = substitute(string, '\(\d\+\)\s\?-\s\?\(\d\+\)', - \ '\=join(range(submatch(1),submatch(2)), ",")', '') + if empty(a:list) + let list=[csv#WColumn()] + else + let string = a:list + if string =~ '\d\s\?-\s\?\d' + let string = substitute(string, '\(\d\+\)\s\?-\s\?\(\d\+\)', + \ '\=join(range(submatch(1),submatch(2)), ",")', '') + endif + let list=split(string, ',') endif - let list=split(string, ',') call csv#DuplicateRows(list) endfu fu! csv#Transpose(line1, line2) "{{{3 -- cgit v1.2.3