Skip to content

Commit

Permalink
fix: No delimiter found with cmdheight=0
Browse files Browse the repository at this point in the history
With `cmdheight=0` substitute command has no output, then
```
            redir => temp[i]
            " use very non-magic
            exe ":silent! :". first. ",". last. 's/\V' . i . "/&/nge"
```
do nothing
  • Loading branch information
hgigas authored May 4, 2023
1 parent 0f6900b commit 12e0cce
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions autoload/csv.vim
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +478,16 @@ fu! csv#GetDelimiter(first, last, ...) "{{{3
" :silent :s does not work with lazyredraw
let _lz = &lz
set nolz
" substitute without output when cmdheight=0
let _cmdheight = &cmdheight
set cmdheight=1
for i in values(Delim)
redir => temp[i]
" use very non-magic
exe ":silent! :". first. ",". last. 's/\V' . i . "/&/nge"
redir END
endfor
let &cmdheight = _cmdheight
let &lz = _lz
let Delim = map(temp, 'matchstr(substitute(v:val, "\n", "", ""), "^\\s*\\d\\+")')
let Delim = filter(temp, 'v:val=~''\d''')
Expand Down

0 comments on commit 12e0cce

Please sign in to comment.