#if defined(FEAT_EVAL)
int do_internal = TRUE;
- if (*curbuf->b_p_fex != NUL)
+ if (*curbuf->b_p_fex != NUL && (flags & INSCHAR_NO_FEX) == 0)
{
do_internal = (fex_format(curwin->w_cursor.lnum, 1L, c) != 0);
/* It may be required to save for undo again, e.g. when setline()
* be adjusted for the text formatting.
*/
saved_cursor = pos;
- format_lines((linenr_T)-1);
+ format_lines((linenr_T)-1, FALSE);
curwin->w_cursor = saved_cursor;
saved_cursor.lnum = 0;
if (keep_cursor)
saved_cursor = oap->cursor_start;
- format_lines(oap->line_count);
+ format_lines(oap->line_count, keep_cursor);
/*
* Leave the cursor at the first non-blank of the last formatted line.
* first line.
*/
void
-format_lines(line_count)
+format_lines(line_count, avoid_fex)
linenr_T line_count;
+ int avoid_fex; /* don't use 'formatexpr' */
{
int max_len;
int is_not_par; /* current line not part of parag. */
#ifdef FEAT_COMMENTS
+ (do_comments ? INSCHAR_DO_COM : 0)
#endif
- , second_indent);
+ + (avoid_fex ? INSCHAR_NO_FEX : 0), second_indent);
State = old_State;
p_smd = smd_save;
second_indent = -1;
void op_format __ARGS((oparg_T *oap, int keep_cursor));
void op_formatexpr __ARGS((oparg_T *oap));
int fex_format __ARGS((linenr_T lnum, long count, int c));
-void format_lines __ARGS((linenr_T line_count));
+void format_lines __ARGS((linenr_T line_count, int avoid_fex));
int paragraph_start __ARGS((linenr_T lnum));
int do_addsub __ARGS((int command, linenr_T Prenum1));
int read_viminfo_register __ARGS((vir_T *virp, int force));
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 276,
/**/
275,
/**/
#define INSCHAR_FORMAT 1 /* force formatting */
#define INSCHAR_DO_COM 2 /* format comments */
#define INSCHAR_CTRLV 4 /* char typed just after CTRL-V */
+#define INSCHAR_NO_FEX 8 /* don't use 'formatexpr' */
/* flags for open_line() */
#define OPENLINE_DELSPACES 1 /* delete spaces after cursor */