Permalink
Browse files

Wrong headerline highlight in empty file

fixes #79 (hopefully)
  • Loading branch information...
1 parent 2cb2b57 commit e0e62fbcf597fd8c39a1e5463122539ed1c42a68 @chrisbra committed Feb 29, 2016
Showing with 4 additions and 1 deletion.
  1. +2 −0 doc/ft-csv.txt
  2. +2 −1 syntax/csv.vim
View
@@ -1617,6 +1617,8 @@ Index;Value1;Value2~
thanks!)
- Statusline function could cause a hang in an empty file (reported by Jeet
Sukumaran in issue https://github.com/chrisbra/csv.vim/issues/80, thanks!)
+- Wrong headerline highlighting when creating a new file (reported by Jeet
+ Sukumaran in issue https://github.com/chrisbra/csv.vim/issues/79, thanks!)
0.31 Jan 15, 2015 {{{1
- supports for Vim 7.3 dropped
View
@@ -74,7 +74,8 @@ fu! <sid>CheckSaneSearchPattern() "{{{3
let cmts = <sid>Esc(s:cmts, '')
let pattern = '\%^\(\%('.cmts.'.*\n\)\|\%(\s*\n\)\)\+'
let start = search(pattern, 'nWe', 10)
- if start > 0
+ " don't do it, on an empty file
+ if start > 0 && !empty(getline(start))
let b:csv_headerline = start+1
endif
endif

0 comments on commit e0e62fb

Please sign in to comment.