summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-11-21 22:27:22 +0100
committerBram Moolenaar <Bram@vim.org>2019-11-21 22:27:22 +0100
commit556ae8ea28b4e3e9fc47ad130795009a3080146e (patch)
tree32c781ddcad0df436d65cdb159dbf1b32635f17d
parent7bae0b1bc84a95d565ffab38cf7f82ad21c656b6 (diff)
downloadvim-git-8.1.2332.tar.gz
patch 8.1.2332: missing file in refactoringv8.1.2332
Problem: Missing file in refactoring. Solution: Update missing file.
-rw-r--r--src/search.c96
-rw-r--r--src/version.c2
2 files changed, 98 insertions, 0 deletions
diff --git a/src/search.c b/src/search.c
index 594911666..ed4ea0d5f 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1918,6 +1918,102 @@ find_rawstring_end(char_u *linep, pos_T *startpos, pos_T *endpos)
}
/*
+ * 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
* off the edge of the file.
diff --git a/src/version.c b/src/version.c
index db3a6637e..0fa2f7d85 100644
--- a/src/version.c
+++ b/src/version.c
@@ -738,6 +738,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2332,
+/**/
2331,
/**/
2330,