Mercurial > vim
comparison src/normal.c @ 10579:688b97124d23 v8.0.0179
patch 8.0.0179: cannot have a local value for 'formatprg'
commit https://github.com/vim/vim/commit/9be7c04e6cd5b0facedcb56b09a5bcfc339efe03
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 14 14:28:30 2017 +0100
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 14 Jan 2017 14:30:04 +0100 |
parents | ae0faad76f9a |
children | 3db97def0f35 |
comparison
equal
deleted
inserted
replaced
10578:6bdfba1a1ee2 | 10579:688b97124d23 |
---|---|
1982 #if defined(FEAT_EVAL) | 1982 #if defined(FEAT_EVAL) |
1983 if (*curbuf->b_p_fex != NUL) | 1983 if (*curbuf->b_p_fex != NUL) |
1984 op_formatexpr(oap); /* use expression */ | 1984 op_formatexpr(oap); /* use expression */ |
1985 else | 1985 else |
1986 #endif | 1986 #endif |
1987 if (*p_fp != NUL) | 1987 if (*p_fp != NUL || *curbuf->b_p_fp != NUL) |
1988 op_colon(oap); /* use external command */ | 1988 op_colon(oap); /* use external command */ |
1989 else | 1989 else |
1990 op_format(oap, FALSE); /* use internal function */ | 1990 op_format(oap, FALSE); /* use internal function */ |
1991 break; | 1991 break; |
1992 | 1992 |
2195 stuffReadbuff(get_equalprg()); | 2195 stuffReadbuff(get_equalprg()); |
2196 stuffReadbuff((char_u *)"\n"); | 2196 stuffReadbuff((char_u *)"\n"); |
2197 } | 2197 } |
2198 else if (oap->op_type == OP_FORMAT) | 2198 else if (oap->op_type == OP_FORMAT) |
2199 { | 2199 { |
2200 if (*p_fp == NUL) | 2200 if (*curbuf->b_p_fp != NUL) |
2201 stuffReadbuff(curbuf->b_p_fp); | |
2202 else if (*p_fp != NUL) | |
2203 stuffReadbuff(p_fp); | |
2204 else | |
2201 stuffReadbuff((char_u *)"fmt"); | 2205 stuffReadbuff((char_u *)"fmt"); |
2202 else | |
2203 stuffReadbuff(p_fp); | |
2204 stuffReadbuff((char_u *)"\n']"); | 2206 stuffReadbuff((char_u *)"\n']"); |
2205 } | 2207 } |
2206 | 2208 |
2207 /* | 2209 /* |
2208 * do_cmdline() does the rest | 2210 * do_cmdline() does the rest |