vim-patch:8.0.0615: using % with :hardcopy wrongly escapes spaces

Problem:    Using % with :hardcopy wrongly escapes spaces. (Alexey Muranov)
Solution:   Expand % differently. (Christian Brabandt, closes vim/vim#1682)
bf15b8d78b
This commit is contained in:
Jan Edmund Lazo 2018-06-19 15:02:02 -04:00
parent a10938ae31
commit 6d4d271694
2 changed files with 28 additions and 18 deletions

View File

@ -4080,6 +4080,7 @@ int expand_filename(exarg_T *eap, char_u **cmdlinep, char_u **errormsgp)
&& eap->cmdidx != CMD_lgrep
&& eap->cmdidx != CMD_grepadd
&& eap->cmdidx != CMD_lgrepadd
&& eap->cmdidx != CMD_hardcopy
&& !(eap->argt & NOSPC)
) {
char_u *l;

View File

@ -61,3 +61,12 @@ func Test_with_syntax()
set printoptions&
endif
endfunc
func Test_fname_with_spaces()
split t\ e\ s\ t.txt
call setline(1, ['just', 'some', 'text'])
hardcopy > %.ps
call assert_true(filereadable('t e s t.txt.ps'))
call delete('t e s t.txt.ps')
bwipe!
endfunc