# HG changeset patch # User Christian Brabandt # Date 1496601905 -7200 # Node ID 6fff8b86e9bda5a4d728fb49f55c96fd9ee243bf # Parent 2bce57faccda521d595fa5822513e0138daf946a patch 8.0.0615: using % with :hardcopy wrongly escapes spaces commit https://github.com/vim/vim/commit/bf15b8d78b22661db8b19d662b62bb9a061cdd37 Author: Bram Moolenaar Date: Sun Jun 4 20:43:48 2017 +0200 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 https://github.com/vim/vim/issues/1682) diff --git a/src/ex_docmd.c b/src/ex_docmd.c --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -5042,6 +5042,7 @@ expand_filename( && eap->cmdidx != CMD_lgrep && eap->cmdidx != CMD_grepadd && eap->cmdidx != CMD_lgrepadd + && eap->cmdidx != CMD_hardcopy #ifndef UNIX && !(eap->argt & NOSPC) #endif diff --git a/src/testdir/test_hardcopy.vim b/src/testdir/test_hardcopy.vim --- a/src/testdir/test_hardcopy.vim +++ b/src/testdir/test_hardcopy.vim @@ -60,3 +60,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 diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -765,6 +765,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 615, +/**/ 614, /**/ 613,