Mirror of the Vim source from https://github.com/vim/vim
Revision | ed7fefbef738386c39248b501556bdea80d0f8b4 (tree) |
---|---|
Time | 2008-03-13 01:27:00 |
Author | vimboss |
Commiter | vimboss |
updated for version 7.1-276
@@ -5491,7 +5491,7 @@ | ||
5491 | 5491 | #if defined(FEAT_EVAL) |
5492 | 5492 | int do_internal = TRUE; |
5493 | 5493 | |
5494 | - if (*curbuf->b_p_fex != NUL) | |
5494 | + if (*curbuf->b_p_fex != NUL && (flags & INSCHAR_NO_FEX) == 0) | |
5495 | 5495 | { |
5496 | 5496 | do_internal = (fex_format(curwin->w_cursor.lnum, 1L, c) != 0); |
5497 | 5497 | /* It may be required to save for undo again, e.g. when setline() |
@@ -6057,7 +6057,7 @@ | ||
6057 | 6057 | * be adjusted for the text formatting. |
6058 | 6058 | */ |
6059 | 6059 | saved_cursor = pos; |
6060 | - format_lines((linenr_T)-1); | |
6060 | + format_lines((linenr_T)-1, FALSE); | |
6061 | 6061 | curwin->w_cursor = saved_cursor; |
6062 | 6062 | saved_cursor.lnum = 0; |
6063 | 6063 |
@@ -4380,7 +4380,7 @@ | ||
4380 | 4380 | if (keep_cursor) |
4381 | 4381 | saved_cursor = oap->cursor_start; |
4382 | 4382 | |
4383 | - format_lines(oap->line_count); | |
4383 | + format_lines(oap->line_count, keep_cursor); | |
4384 | 4384 | |
4385 | 4385 | /* |
4386 | 4386 | * Leave the cursor at the first non-blank of the last formatted line. |
@@ -4495,8 +4495,9 @@ | ||
4495 | 4495 | * first line. |
4496 | 4496 | */ |
4497 | 4497 | void |
4498 | -format_lines(line_count) | |
4498 | +format_lines(line_count, avoid_fex) | |
4499 | 4499 | linenr_T line_count; |
4500 | + int avoid_fex; /* don't use 'formatexpr' */ | |
4500 | 4501 | { |
4501 | 4502 | int max_len; |
4502 | 4503 | int is_not_par; /* current line not part of parag. */ |
@@ -4666,7 +4667,7 @@ | ||
4666 | 4667 | #ifdef FEAT_COMMENTS |
4667 | 4668 | + (do_comments ? INSCHAR_DO_COM : 0) |
4668 | 4669 | #endif |
4669 | - , second_indent); | |
4670 | + + (avoid_fex ? INSCHAR_NO_FEX : 0), second_indent); | |
4670 | 4671 | State = old_State; |
4671 | 4672 | p_smd = smd_save; |
4672 | 4673 | second_indent = -1; |
@@ -41,7 +41,7 @@ | ||
41 | 41 | void op_format __ARGS((oparg_T *oap, int keep_cursor)); |
42 | 42 | void op_formatexpr __ARGS((oparg_T *oap)); |
43 | 43 | int fex_format __ARGS((linenr_T lnum, long count, int c)); |
44 | -void format_lines __ARGS((linenr_T line_count)); | |
44 | +void format_lines __ARGS((linenr_T line_count, int avoid_fex)); | |
45 | 45 | int paragraph_start __ARGS((linenr_T lnum)); |
46 | 46 | int do_addsub __ARGS((int command, linenr_T Prenum1)); |
47 | 47 | int read_viminfo_register __ARGS((vir_T *virp, int force)); |
@@ -667,6 +667,8 @@ | ||
667 | 667 | static int included_patches[] = |
668 | 668 | { /* Add new patch number below this line */ |
669 | 669 | /**/ |
670 | + 276, | |
671 | +/**/ | |
670 | 672 | 275, |
671 | 673 | /**/ |
672 | 674 | 274, |
@@ -949,6 +949,7 @@ | ||
949 | 949 | #define INSCHAR_FORMAT 1 /* force formatting */ |
950 | 950 | #define INSCHAR_DO_COM 2 /* format comments */ |
951 | 951 | #define INSCHAR_CTRLV 4 /* char typed just after CTRL-V */ |
952 | +#define INSCHAR_NO_FEX 8 /* don't use 'formatexpr' */ | |
952 | 953 | |
953 | 954 | /* flags for open_line() */ |
954 | 955 | #define OPENLINE_DELSPACES 1 /* delete spaces after cursor */ |