mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.0.0179: cannot have a local value for 'formatprg'
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)
This commit is contained in:
10
src/normal.c
10
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']");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user