aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-06-20 00:58:33 +0200
committerGitHub <noreply@github.com>2018-06-20 00:58:33 +0200
commit18710e77200632b73791ac41824161b2273cb91d (patch)
tree27dfd459d33d3f0fafc4db23e08adba98504f5cf
parentb36aba98408b88be3edd815fee88e969e1a4c081 (diff)
parent14e70878c58e55ff4bc3c73441addfe880493d97 (diff)
downloadrneovim-18710e77200632b73791ac41824161b2273cb91d.tar.gz
rneovim-18710e77200632b73791ac41824161b2273cb91d.tar.bz2
rneovim-18710e77200632b73791ac41824161b2273cb91d.zip
Merge #8596 from janlazo/vim-8.0.0615
-rw-r--r--src/nvim/ex_docmd.c45
-rw-r--r--src/nvim/testdir/test_hardcopy.vim11
2 files changed, 34 insertions, 22 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index b59f852c2d..f0e4883fdd 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -2315,11 +2315,11 @@ doend:
* Check for an Ex command with optional tail.
* If there is a match advance "pp" to the argument and return TRUE.
*/
-int
-checkforcmd (
- char_u **pp, /* start of command */
- char *cmd, /* name of command */
- int len /* required length */
+int
+checkforcmd(
+ char_u **pp, // start of command
+ char *cmd, // name of command
+ int len // required length
)
{
int i;
@@ -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;
@@ -4702,9 +4703,9 @@ char_u *check_nextcmd(char_u *p)
* return FAIL and give error message if 'message' TRUE
* return OK otherwise
*/
-static int
-check_more (
- int message, /* when FALSE check only, no messages */
+static int
+check_more(
+ int message, // when FALSE check only, no messages
int forceit
)
{
@@ -5371,8 +5372,8 @@ static size_t add_cmd_modifier(char_u *buf, char *mod_str, bool *multi_mods)
* Returns the length of the replacement, which has been added to "buf".
* Returns -1 if there was no match, and only the "<" has been copied.
*/
-static size_t
-uc_check_code (
+static size_t
+uc_check_code(
char_u *code,
size_t len,
char_u *buf,
@@ -6104,8 +6105,8 @@ static void ex_pclose(exarg_T *eap)
* Close window "win" and take care of handling closing the last window for a
* modified buffer.
*/
-static void
-ex_win_close (
+static void
+ex_win_close(
int forceit,
win_T *win,
tabpage_T *tp /* NULL or the tab page "win" is in */
@@ -6521,8 +6522,8 @@ void alist_set(alist_T *al, int count, char_u **files, int use_curbuf, int *fnum
* Add file "fname" to argument list "al".
* "fname" must have been allocated and "al" must have been checked for room.
*/
-void
-alist_add (
+void
+alist_add(
alist_T *al,
char_u *fname,
int set_fnum /* 1: set buffer number; 2: re-use curbuf */
@@ -6869,8 +6870,8 @@ static void ex_edit(exarg_T *eap)
/*
* ":edit <file>" command and alikes.
*/
-void
-do_exedit (
+void
+do_exedit(
exarg_T *eap,
win_T *old_curwin /* curwin before doing a split or NULL */
)
@@ -8760,8 +8761,8 @@ char_u *expand_sfile(char_u *arg)
* Write openfile commands for the current buffers to an .exrc file.
* Return FAIL on error, OK otherwise.
*/
-static int
-makeopens (
+static int
+makeopens(
FILE *fd,
char_u *dirnow /* Current directory name */
)
@@ -9207,8 +9208,8 @@ static int ses_do_win(win_T *wp)
* Write commands to "fd" to restore the view of a window.
* Caller must make sure 'scrolloff' is zero.
*/
-static int
-put_view (
+static int
+put_view(
FILE *fd,
win_T *wp,
int add_edit, /* add ":edit" command to view */
@@ -9402,8 +9403,8 @@ put_view (
* Write an argument list to the session file.
* Returns FAIL if writing fails.
*/
-static int
-ses_arglist (
+static int
+ses_arglist(
FILE *fd,
char *cmd,
garray_T *gap,
diff --git a/src/nvim/testdir/test_hardcopy.vim b/src/nvim/testdir/test_hardcopy.vim
index 7aea704e86..f630556bef 100644
--- a/src/nvim/testdir/test_hardcopy.vim
+++ b/src/nvim/testdir/test_hardcopy.vim
@@ -61,3 +61,14 @@ func Test_with_syntax()
set printoptions&
endif
endfunc
+
+func Test_fname_with_spaces()
+ if has('postscript')
+ 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!
+ endif
+endfunc