Skip to content

Commit bf15b8d

Browse files
committed
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 #1682)
1 parent 863e80b commit bf15b8d

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

src/ex_docmd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5042,6 +5042,7 @@ expand_filename(
50425042
&& eap->cmdidx != CMD_lgrep
50435043
&& eap->cmdidx != CMD_grepadd
50445044
&& eap->cmdidx != CMD_lgrepadd
5045+
&& eap->cmdidx != CMD_hardcopy
50455046
#ifndef UNIX
50465047
&& !(eap->argt & NOSPC)
50475048
#endif

src/testdir/test_hardcopy.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,12 @@ func Test_with_syntax()
6060
set printoptions&
6161
endif
6262
endfunc
63+
64+
func Test_fname_with_spaces()
65+
split t\ e\ s\ t.txt
66+
call setline(1, ['just', 'some', 'text'])
67+
hardcopy > %.ps
68+
call assert_true(filereadable('t e s t.txt.ps'))
69+
call delete('t e s t.txt.ps')
70+
bwipe!
71+
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
615,
767769
/**/
768770
614,
769771
/**/

0 commit comments

Comments
 (0)