Skip to content

Commit

Permalink
DeleteColumn now outputs how many columns have been deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbra committed Apr 12, 2012
1 parent 15e06e8 commit 01ae80e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/ft-csv.txt
Expand Up @@ -1254,7 +1254,7 @@ Alternatively, you can simply call |InitCSV| and ignore the error.
==============================================================================
7. CSV Changelog *csv-changelog*

0.24 (unreleased) {{{1
0.24 Apr 12, 2012 {{{1
- Allow to transpose the file (|csv-transpose|, suggested by Karan Mistry,
thanks!)
- |DeleteColumn_CSV| allows to specify a search pattern and all matching
Expand Down
12 changes: 10 additions & 2 deletions ftplugin/csv.vim
Expand Up @@ -307,14 +307,22 @@ endfu
fu! <sid>DeleteColumn(arg) "{{{3
let _wsv = winsaveview()
if a:arg =~ '^[/]'
let i = 0
let pat = a:arg[1:]
call cursor(1,1)
while search(pat, 'cW')
" Delete matching column
call <sid>DelColumn('')
sil call <sid>DelColumn('')
let i+=1
endw
else
call <sid>DelColumn(a:arg)
let i = 1
sil call <sid>DelColumn(a:arg)
endif
if i > 1
call <sid>Warn(printf("%d columns deleted", i))
else
call <sid>Warn("1 column deleted")
endif
call winrestview(_wsv)
endfu
Expand Down

0 comments on commit 01ae80e

Please sign in to comment.