0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

When 'formatexpr' evaluates to non-zero fall back to internal formatting, also

for "gq". (James Vega)
This commit is contained in:
Bram Moolenaar
2010-07-11 17:35:50 +02:00
parent 3acfc30409
commit 700303e8f7
3 changed files with 8 additions and 4 deletions

View File

@@ -3126,8 +3126,10 @@ A jump table for the options with a short description can be found at |Q_op|.
text beyond that limit. This happens under the same conditions as text beyond that limit. This happens under the same conditions as
when internal formatting is used. Make sure the cursor is kept in the when internal formatting is used. Make sure the cursor is kept in the
same spot relative to the text then! The |mode()| function will same spot relative to the text then! The |mode()| function will
return "i" or "R" in this situation. When the function returns return "i" or "R" in this situation.
non-zero Vim will fall back to using the internal format mechanism.
When the expression evaluates to non-zero Vim will fall back to using
the internal format mechanism.
The expression may be evaluated in the |sandbox|, see The expression may be evaluated in the |sandbox|, see
|sandbox-option|. |sandbox-option|.

View File

@@ -1093,7 +1093,6 @@ Vim 7.3:
- Conceal feature: no update when moving to another window. (Dominique Pelle, - Conceal feature: no update when moving to another window. (Dominique Pelle,
2010 Jul 5) Vince will look into it. 2010 Jul 5) Vince will look into it.
Patches to possibly include: Patches to possibly include:
- Patch to improve javascript indenting. (Hari Kumar G, 2010 May 22)
- Patch to use return value of 'formatexpr'. (James Vega, 2010 Jun 16) - Patch to use return value of 'formatexpr'. (James Vega, 2010 Jun 16)
- Patch for gtk main_loop() to enable GtkFileChooser. (James Vega, 2010 Jun 28) - Patch for gtk main_loop() to enable GtkFileChooser. (James Vega, 2010 Jun 28)
Same as this one? GTK: file chooser is disabled. Patch by Tim Starling, Same as this one? GTK: file chooser is disabled. Patch by Tim Starling,

View File

@@ -4475,7 +4475,10 @@ op_formatexpr(oap)
redraw_curbuf_later(INVERTED); redraw_curbuf_later(INVERTED);
# endif # endif
(void)fex_format(oap->start.lnum, oap->line_count, NUL); if (fex_format(oap->start.lnum, oap->line_count, NUL) != 0)
/* As documented: when 'formatexpr' returns non-zero fall back to
* internal formatting. */
op_format(oap, FALSE);
} }
int int