0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

updated for version 7.1-276

This commit is contained in:
Bram Moolenaar 2008-03-12 16:27:00 +00:00
parent 1b60e50bf2
commit 81a8209323
5 changed files with 10 additions and 6 deletions

View File

@ -5491,7 +5491,7 @@ insertchar(c, flags, second_indent)
#if defined(FEAT_EVAL) #if defined(FEAT_EVAL)
int do_internal = TRUE; 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); do_internal = (fex_format(curwin->w_cursor.lnum, 1L, c) != 0);
/* It may be required to save for undo again, e.g. when setline() /* It may be required to save for undo again, e.g. when setline()
@ -6057,7 +6057,7 @@ auto_format(trailblank, prev_line)
* be adjusted for the text formatting. * be adjusted for the text formatting.
*/ */
saved_cursor = pos; saved_cursor = pos;
format_lines((linenr_T)-1); format_lines((linenr_T)-1, FALSE);
curwin->w_cursor = saved_cursor; curwin->w_cursor = saved_cursor;
saved_cursor.lnum = 0; saved_cursor.lnum = 0;

View File

@ -4380,7 +4380,7 @@ op_format(oap, keep_cursor)
if (keep_cursor) if (keep_cursor)
saved_cursor = oap->cursor_start; 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. * Leave the cursor at the first non-blank of the last formatted line.
@ -4495,8 +4495,9 @@ fex_format(lnum, count, c)
* first line. * first line.
*/ */
void void
format_lines(line_count) format_lines(line_count, avoid_fex)
linenr_T line_count; linenr_T line_count;
int avoid_fex; /* don't use 'formatexpr' */
{ {
int max_len; int max_len;
int is_not_par; /* current line not part of parag. */ int is_not_par; /* current line not part of parag. */
@ -4666,7 +4667,7 @@ format_lines(line_count)
#ifdef FEAT_COMMENTS #ifdef FEAT_COMMENTS
+ (do_comments ? INSCHAR_DO_COM : 0) + (do_comments ? INSCHAR_DO_COM : 0)
#endif #endif
, second_indent); + (avoid_fex ? INSCHAR_NO_FEX : 0), second_indent);
State = old_State; State = old_State;
p_smd = smd_save; p_smd = smd_save;
second_indent = -1; second_indent = -1;

View File

@ -41,7 +41,7 @@ int do_join __ARGS((int insert_space));
void op_format __ARGS((oparg_T *oap, int keep_cursor)); void op_format __ARGS((oparg_T *oap, int keep_cursor));
void op_formatexpr __ARGS((oparg_T *oap)); void op_formatexpr __ARGS((oparg_T *oap));
int fex_format __ARGS((linenr_T lnum, long count, int c)); 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 paragraph_start __ARGS((linenr_T lnum));
int do_addsub __ARGS((int command, linenr_T Prenum1)); int do_addsub __ARGS((int command, linenr_T Prenum1));
int read_viminfo_register __ARGS((vir_T *virp, int force)); int read_viminfo_register __ARGS((vir_T *virp, int force));

View File

@ -666,6 +666,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
276,
/**/ /**/
275, 275,
/**/ /**/

View File

@ -949,6 +949,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
#define INSCHAR_FORMAT 1 /* force formatting */ #define INSCHAR_FORMAT 1 /* force formatting */
#define INSCHAR_DO_COM 2 /* format comments */ #define INSCHAR_DO_COM 2 /* format comments */
#define INSCHAR_CTRLV 4 /* char typed just after CTRL-V */ #define INSCHAR_CTRLV 4 /* char typed just after CTRL-V */
#define INSCHAR_NO_FEX 8 /* don't use 'formatexpr' */
/* flags for open_line() */ /* flags for open_line() */
#define OPENLINE_DELSPACES 1 /* delete spaces after cursor */ #define OPENLINE_DELSPACES 1 /* delete spaces after cursor */