diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2021-04-14 11:59:14 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2021-04-14 11:59:22 +0200 |
commit | 9e45c07a8d2eb77a1d276f762a448f42a33a47c6 (patch) | |
tree | f7a2926e460a75b7bd5b7498576042275e9fa57f /autoload/csv.vim | |
parent | 3c5fca7621a1f5e53911195ebb6e7c777fad8031 (diff) | |
download | vim-polyglot-9e45c07a8d2eb77a1d276f762a448f42a33a47c6.tar.gz vim-polyglot-9e45c07a8d2eb77a1d276f762a448f42a33a47c6.zip |
Update
Diffstat (limited to 'autoload/csv.vim')
-rw-r--r-- | autoload/csv.vim | 17 |
1 files changed, 10 insertions, 7 deletions
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(<q-args>, 1, line(''$''))', \ '-nargs=1') call csv#LocalCmd("Duplicates", ':call csv#CheckDuplicates(<q-args>)', - \ '-nargs=1 -complete=custom,csv#CompleteColumnNr') + \ '-nargs=? -complete=custom,csv#CompleteColumnNr') call csv#LocalCmd('Transpose', ':call csv#Transpose(<line1>, <line2>)', \ '-range=%') call csv#LocalCmd('CSVTabularize', ':call csv#Tabularize(<bang>0,<line1>,<line2>)', @@ -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 |