Skip to content

Commit

Permalink
Allow for whitespace in :SearchInColumn pattern
Browse files Browse the repository at this point in the history
this allows :SearchInColumn command to work correctly
even when the columns was visually aligned using :ArrangeCol
command

fixes #100
  • Loading branch information
chrisbra committed Jan 19, 2017
1 parent cceabea commit b64fb68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -87,6 +87,8 @@
https://github.com/chrisbra/csv.vim/issues/98, thanks!)
- Allow for better aligning of columns (reported by taylor-peterson in
https://github.com/chrisbra/csv.vim/issues/99, thanks!)
- `:SearchInColumn` did not work correctly for the last column, if `:ArrangeColumn`
has been used (reported by Xavier Laviron in #100, thanks!)

## 0.31 Jan 15, 2015
- supports for Vim 7.3 dropped
Expand Down
4 changes: 3 additions & 1 deletion ftplugin/csv.vim
Expand Up @@ -257,8 +257,10 @@ fu! <sid>GetPat(colnr, maxcolnr, pat, allowmore) "{{{3
endif
elseif a:colnr == a:maxcolnr
if !exists("b:csv_fixed_width_cols")
" Allow space in front of the pattern, so that it works correctly
" even if :Arrange Col has been used #100
return '^' . <SID>GetColPat(a:colnr - 1,0) .
\ '\zs' . a:pat . '\ze' . (a:allowmore ? '' : '$')
\ '\s*\zs' . a:pat . '\ze' . (a:allowmore ? '' : '$')
else
return '\%' . b:csv_fixed_width_cols[-1] .
\ 'c\zs' . a:pat . '\ze' . (a:allowmore ? '' : '$')
Expand Down

0 comments on commit b64fb68

Please sign in to comment.