summaryrefslogtreecommitdiffstats
path: root/ftplugin/csv.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2013-12-26 03:34:22 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2013-12-26 03:34:22 +0100
commita26bebbeb94207698d20f43485098ead64bb6c67 (patch)
treeac829c223694513dfc9b90c592001d2ea31d07d4 /ftplugin/csv.vim
parentedd5ee63e66d9ef166034d9ac5bed132f501ecb9 (diff)
downloadvim-polyglot-a26bebbeb94207698d20f43485098ead64bb6c67.tar.gz
vim-polyglot-a26bebbeb94207698d20f43485098ead64bb6c67.zip
Update
Diffstat (limited to 'ftplugin/csv.vim')
-rw-r--r--ftplugin/csv.vim10
1 files changed, 8 insertions, 2 deletions
diff --git a/ftplugin/csv.vim b/ftplugin/csv.vim
index 596012a3..20532744 100644
--- a/ftplugin/csv.vim
+++ b/ftplugin/csv.vim
@@ -1606,6 +1606,9 @@ fu! <sid>AnalyzeColumn(...) "{{{3
let qty = len(data)
let res = {}
for item in data
+ if empty(item)
+ let item = 'NULL'
+ endif
if !get(res, item)
let res[item] = 0
endif
@@ -1613,6 +1616,7 @@ fu! <sid>AnalyzeColumn(...) "{{{3
endfor
let max_items = reverse(sort(values(res)))
+ let count_items = keys(res)
if len(max_items) > 5
call remove(max_items, 5, -1)
call filter(res, 'v:val =~ ''^''.join(max_items, ''\|'').''$''')
@@ -1623,9 +1627,9 @@ fu! <sid>AnalyzeColumn(...) "{{{3
else
let title="Nr\tCount\tValue"
endif
- echohl "Title"
+ echohl Title
echo printf("%s", title)
- echohl "Normal"
+ echohl Normal
echo printf("%s", repeat('=', strdisplaywidth(title)))
let i=1
@@ -1650,6 +1654,8 @@ fu! <sid>AnalyzeColumn(...) "{{{3
endif
endfor
endfor
+ echo printf("%s", repeat('=', strdisplaywidth(title)))
+ echo printf("different values: %d", len(count_items))
unlet max_items
endfunc