summaryrefslogtreecommitdiff
path: root/src/normal.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-01-14 14:28:30 +0100
committerBram Moolenaar <Bram@vim.org>2017-01-14 14:28:30 +0100
commit9be7c04e6cd5b0facedcb56b09a5bcfc339efe03 (patch)
tree8904427003c2cea7b63ffae1e0570a54f5c77e87 /src/normal.c
parent9b73c4a215cb5f0f7df1e7f0663aea2bce1914ab (diff)
downloadvim-git-9be7c04e6cd5b0facedcb56b09a5bcfc339efe03.tar.gz
patch 8.0.0179: cannot have a local value for 'formatprg'v8.0.0179
Problem: 'formatprg' is a global option but the value may depend on the type of buffer. (Sung Pae) Solution: Make 'formatprg' global-local. (closes #1380)
Diffstat (limited to 'src/normal.c')
-rw-r--r--src/normal.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/normal.c b/src/normal.c
index 5d0796f47..3456b73be 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -1984,7 +1984,7 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
op_formatexpr(oap); /* use expression */
else
#endif
- if (*p_fp != NUL)
+ if (*p_fp != NUL || *curbuf->b_p_fp != NUL)
op_colon(oap); /* use external command */
else
op_format(oap, FALSE); /* use internal function */
@@ -2197,10 +2197,12 @@ op_colon(oparg_T *oap)
}
else if (oap->op_type == OP_FORMAT)
{
- if (*p_fp == NUL)
- stuffReadbuff((char_u *)"fmt");
- else
+ if (*curbuf->b_p_fp != NUL)
+ stuffReadbuff(curbuf->b_p_fp);
+ else if (*p_fp != NUL)
stuffReadbuff(p_fp);
+ else
+ stuffReadbuff((char_u *)"fmt");
stuffReadbuff((char_u *)"\n']");
}