]> granicus.if.org Git - vim/commitdiff
updated for version 7.1-276 v7.1.276
authorBram Moolenaar <Bram@vim.org>
Wed, 12 Mar 2008 16:27:00 +0000 (16:27 +0000)
committerBram Moolenaar <Bram@vim.org>
Wed, 12 Mar 2008 16:27:00 +0000 (16:27 +0000)
src/edit.c
src/ops.c
src/proto/ops.pro
src/version.c
src/vim.h

index 6a2f9518dbf75030119fbc028ae03ed572dbf824..fb17eecc9e2600acbffc87b1275383797e2f4aa7 100644 (file)
@@ -5491,7 +5491,7 @@ insertchar(c, flags, second_indent)
 #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()
@@ -6057,7 +6057,7 @@ auto_format(trailblank, prev_line)
      * 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;
 
index 5433f3852697ff14def568a156faf6cb6d7290b8..ba774b8772440eb0742642b4a90096efd51fdfa1 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -4380,7 +4380,7 @@ op_format(oap, keep_cursor)
     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.
@@ -4495,8 +4495,9 @@ fex_format(lnum, count, c)
  * 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. */
@@ -4666,7 +4667,7 @@ format_lines(line_count)
 #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;
index 9ce80b3a9ceeaa2e84f7d2dbc1f994a237f66eef..37c319414ff29f50acd082905629ca802a52fae4 100644 (file)
@@ -41,7 +41,7 @@ int do_join __ARGS((int insert_space));
 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));
index ef0d8d00cd263845f9264bcb1874883b2e6d1438..504f855a75329d4a43a1320f0ed208677200537f 100644 (file)
@@ -666,6 +666,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    276,
 /**/
     275,
 /**/
index 7de2b6f4991df4593dff794ee6627a3e44e2e4dc..989dd23cef2acb00fe0ce6f6d696009f14cfe563 100644 (file)
--- a/src/vim.h
+++ b/src/vim.h
@@ -949,6 +949,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
 #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 */