]> granicus.if.org Git - vim/commitdiff
patch 8.1.2332: missing file in refactoring v8.1.2332
authorBram Moolenaar <Bram@vim.org>
Thu, 21 Nov 2019 21:27:22 +0000 (22:27 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 21 Nov 2019 21:27:22 +0000 (22:27 +0100)
Problem:    Missing file in refactoring.
Solution:   Update missing file.

src/search.c
src/version.c

index 59491166692f17f2b0b8a2201c61cfd4d0c92287..ed4ea0d5f0589ec265b0e924c5df3423f482b189 100644 (file)
@@ -1917,6 +1917,102 @@ find_rawstring_end(char_u *linep, pos_T *startpos, pos_T *endpos)
     return found;
 }
 
+/*
+ * Check matchpairs option for "*initc".
+ * If there is a match set "*initc" to the matching character and "*findc" to
+ * the opposite character.  Set "*backwards" to the direction.
+ * When "switchit" is TRUE swap the direction.
+ */
+    static void
+find_mps_values(
+    int            *initc,
+    int            *findc,
+    int            *backwards,
+    int            switchit)
+{
+    char_u     *ptr;
+
+    ptr = curbuf->b_p_mps;
+    while (*ptr != NUL)
+    {
+       if (has_mbyte)
+       {
+           char_u *prev;
+
+           if (mb_ptr2char(ptr) == *initc)
+           {
+               if (switchit)
+               {
+                   *findc = *initc;
+                   *initc = mb_ptr2char(ptr + mb_ptr2len(ptr) + 1);
+                   *backwards = TRUE;
+               }
+               else
+               {
+                   *findc = mb_ptr2char(ptr + mb_ptr2len(ptr) + 1);
+                   *backwards = FALSE;
+               }
+               return;
+           }
+           prev = ptr;
+           ptr += mb_ptr2len(ptr) + 1;
+           if (mb_ptr2char(ptr) == *initc)
+           {
+               if (switchit)
+               {
+                   *findc = *initc;
+                   *initc = mb_ptr2char(prev);
+                   *backwards = FALSE;
+               }
+               else
+               {
+                   *findc = mb_ptr2char(prev);
+                   *backwards = TRUE;
+               }
+               return;
+           }
+           ptr += mb_ptr2len(ptr);
+       }
+       else
+       {
+           if (*ptr == *initc)
+           {
+               if (switchit)
+               {
+                   *backwards = TRUE;
+                   *findc = *initc;
+                   *initc = ptr[2];
+               }
+               else
+               {
+                   *backwards = FALSE;
+                   *findc = ptr[2];
+               }
+               return;
+           }
+           ptr += 2;
+           if (*ptr == *initc)
+           {
+               if (switchit)
+               {
+                   *backwards = FALSE;
+                   *findc = *initc;
+                   *initc = ptr[-2];
+               }
+               else
+               {
+                   *backwards = TRUE;
+                   *findc =  ptr[-2];
+               }
+               return;
+           }
+           ++ptr;
+       }
+       if (*ptr == ',')
+           ++ptr;
+    }
+}
+
 /*
  * findmatchlimit -- find the matching paren or brace, if it exists within
  * maxtravel lines of the cursor.  A maxtravel of 0 means search until falling
index db3a6637ea5647a473ddb42be28a2c2de3096c41..0fa2f7d8520d49629f6efa37598379d6ff703e12 100644 (file)
@@ -737,6 +737,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2332,
 /**/
     2331,
 /**/