summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.1124
diff options
context:
space:
mode:
Diffstat (limited to 'data/vim/patches/8.1.1124')
-rw-r--r--data/vim/patches/8.1.1124901
1 files changed, 901 insertions, 0 deletions
diff --git a/data/vim/patches/8.1.1124 b/data/vim/patches/8.1.1124
new file mode 100644
index 000000000..0b149684b
--- /dev/null
+++ b/data/vim/patches/8.1.1124
@@ -0,0 +1,901 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 8.1.1124
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 8.1.1124
+Problem: Insert completion flags are mixed up.
+Solution: Clean up flags use of ins_compl_add() and cp_flags.
+Files: src/insexpand.c, src/proto/insexpand.pro, src/search.c, src/spell.c
+
+
+*** ../vim-8.1.1123/src/insexpand.c 2019-04-06 13:45:51.568756943 +0200
+--- src/insexpand.c 2019-04-06 14:14:19.712671221 +0200
+***************
+*** 102,119 ****
+ compl_T *cp_next;
+ compl_T *cp_prev;
+ char_u *cp_str; // matched text
+- char cp_icase; // TRUE or FALSE: ignore case
+- char cp_equal; // TRUE or FALSE: ins_compl_equal always ok
+ char_u *(cp_text[CPT_COUNT]); // text for the menu
+ char_u *cp_fname; // file containing the match, allocated when
+! // cp_flags has FREE_FNAME
+! int cp_flags; // ORIGINAL_TEXT, CONT_S_IPOS or FREE_FNAME
+ int cp_number; // sequence number
+ };
+
+! // flags for ins_compl_add()
+! # define ORIGINAL_TEXT (1) // the original text when the expansion begun
+! # define FREE_FNAME (2)
+
+ static char e_hitend[] = N_("Hit end of paragraph");
+ # ifdef FEAT_COMPL_FUNC
+--- 102,120 ----
+ compl_T *cp_next;
+ compl_T *cp_prev;
+ char_u *cp_str; // matched text
+ char_u *(cp_text[CPT_COUNT]); // text for the menu
+ char_u *cp_fname; // file containing the match, allocated when
+! // cp_flags has CP_FREE_FNAME
+! int cp_flags; // CP_ values
+ int cp_number; // sequence number
+ };
+
+! // values for cp_flags
+! # define CP_ORIGINAL_TEXT 1 // the original text when the expansion begun
+! # define CP_FREE_FNAME 2 // cp_fname is allocated
+! # define CP_CONT_S_IPOS 4 // use CONT_S_IPOS for compl_cont_status
+! # define CP_EQUAL 8 // ins_compl_equal() always returns TRUE
+! # define CP_ICASE 16 // ins_compl_equal() ignores case
+
+ static char e_hitend[] = N_("Hit end of paragraph");
+ # ifdef FEAT_COMPL_FUNC
+***************
+*** 185,191 ****
+ static int compl_opt_refresh_always = FALSE;
+ static int compl_opt_suppress_empty = FALSE;
+
+! static int ins_compl_add(char_u *str, int len, int icase, char_u *fname, char_u **cptext, int cdir, int flags, int adup, int equal);
+ static void ins_compl_longest_match(compl_T *match);
+ static void ins_compl_del_pum(void);
+ static void ins_compl_files(int count, char_u **files, int thesaurus, int flags, regmatch_T *regmatch, char_u *buf, int *dir);
+--- 186,192 ----
+ static int compl_opt_refresh_always = FALSE;
+ static int compl_opt_suppress_empty = FALSE;
+
+! static int ins_compl_add(char_u *str, int len, char_u *fname, char_u **cptext, int cdir, int flags, int adup);
+ static void ins_compl_longest_match(compl_T *match);
+ static void ins_compl_del_pum(void);
+ static void ins_compl_files(int count, char_u **files, int thesaurus, int flags, regmatch_T *regmatch, char_u *buf, int *dir);
+***************
+*** 420,426 ****
+ int icase,
+ char_u *fname,
+ int dir,
+! int flags)
+ {
+ char_u *str = str_arg;
+ char_u *p;
+--- 421,427 ----
+ int icase,
+ char_u *fname,
+ int dir,
+! int cont_s_ipos) // next ^X<> will set initial_pos
+ {
+ char_u *str = str_arg;
+ char_u *p;
+***************
+*** 431,436 ****
+--- 432,438 ----
+ int *wca; // Wide character array.
+ int has_lower = FALSE;
+ int was_letter = FALSE;
++ int flags = 0;
+
+ if (p_ic && curbuf->b_p_inf && len > 0)
+ {
+***************
+*** 555,563 ****
+
+ str = IObuff;
+ }
+
+! return ins_compl_add(str, len, icase, fname, NULL, dir,
+! flags, FALSE, FALSE);
+ }
+
+ /*
+--- 557,568 ----
+
+ str = IObuff;
+ }
++ if (cont_s_ipos)
++ flags |= CP_CONT_S_IPOS;
++ if (icase)
++ flags |= CP_ICASE;
+
+! return ins_compl_add(str, len, fname, NULL, dir, flags, FALSE);
+ }
+
+ /*
+***************
+*** 570,585 ****
+ ins_compl_add(
+ char_u *str,
+ int len,
+- int icase,
+ char_u *fname,
+ char_u **cptext, // extra text for popup menu or NULL
+ int cdir,
+! int flags,
+! int adup, // accept duplicate match
+! int equal) // match is always accepted by ins_compl_equal
+ {
+ compl_T *match;
+ int dir = (cdir == 0 ? compl_direction : cdir);
+
+ ui_breakcheck();
+ if (got_int)
+--- 575,589 ----
+ ins_compl_add(
+ char_u *str,
+ int len,
+ char_u *fname,
+ char_u **cptext, // extra text for popup menu or NULL
+ int cdir,
+! int flags_arg,
+! int adup) // accept duplicate match
+ {
+ compl_T *match;
+ int dir = (cdir == 0 ? compl_direction : cdir);
++ int flags = flags_arg;
+
+ ui_breakcheck();
+ if (got_int)
+***************
+*** 593,599 ****
+ match = compl_first_match;
+ do
+ {
+! if ( !(match->cp_flags & ORIGINAL_TEXT)
+ && STRNCMP(match->cp_str, str, len) == 0
+ && match->cp_str[len] == NUL)
+ return NOTDONE;
+--- 597,603 ----
+ match = compl_first_match;
+ do
+ {
+! if ( !(match->cp_flags & CP_ORIGINAL_TEXT)
+ && STRNCMP(match->cp_str, str, len) == 0
+ && match->cp_str[len] == NUL)
+ return NOTDONE;
+***************
+*** 610,628 ****
+ if (match == NULL)
+ return FAIL;
+ match->cp_number = -1;
+! if (flags & ORIGINAL_TEXT)
+ match->cp_number = 0;
+ if ((match->cp_str = vim_strnsave(str, len)) == NULL)
+ {
+ vim_free(match);
+ return FAIL;
+ }
+- match->cp_icase = icase;
+- match->cp_equal = equal;
+
+ // match-fname is:
+ // - compl_curr_match->cp_fname if it is a string equal to fname.
+! // - a copy of fname, FREE_FNAME is set to free later THE allocated mem.
+ // - NULL otherwise. --Acevedo
+ if (fname != NULL
+ && compl_curr_match != NULL
+--- 614,630 ----
+ if (match == NULL)
+ return FAIL;
+ match->cp_number = -1;
+! if (flags & CP_ORIGINAL_TEXT)
+ match->cp_number = 0;
+ if ((match->cp_str = vim_strnsave(str, len)) == NULL)
+ {
+ vim_free(match);
+ return FAIL;
+ }
+
+ // match-fname is:
+ // - compl_curr_match->cp_fname if it is a string equal to fname.
+! // - a copy of fname, CP_FREE_FNAME is set to free later THE allocated mem.
+ // - NULL otherwise. --Acevedo
+ if (fname != NULL
+ && compl_curr_match != NULL
+***************
+*** 632,638 ****
+ else if (fname != NULL)
+ {
+ match->cp_fname = vim_strsave(fname);
+! flags |= FREE_FNAME;
+ }
+ else
+ match->cp_fname = NULL;
+--- 634,640 ----
+ else if (fname != NULL)
+ {
+ match->cp_fname = vim_strsave(fname);
+! flags |= CP_FREE_FNAME;
+ }
+ else
+ match->cp_fname = NULL;
+***************
+*** 669,675 ****
+ compl_curr_match = match;
+
+ // Find the longest common string if still doing that.
+! if (compl_get_longest && (flags & ORIGINAL_TEXT) == 0)
+ ins_compl_longest_match(match);
+
+ return OK;
+--- 671,677 ----
+ compl_curr_match = match;
+
+ // Find the longest common string if still doing that.
+! if (compl_get_longest && (flags & CP_ORIGINAL_TEXT) == 0)
+ ins_compl_longest_match(match);
+
+ return OK;
+***************
+*** 677,690 ****
+
+ /*
+ * Return TRUE if "str[len]" matches with match->cp_str, considering
+! * match->cp_icase.
+ */
+ static int
+ ins_compl_equal(compl_T *match, char_u *str, int len)
+ {
+! if (match->cp_equal)
+ return TRUE;
+! if (match->cp_icase)
+ return STRNICMP(match->cp_str, str, (size_t)len) == 0;
+ return STRNCMP(match->cp_str, str, (size_t)len) == 0;
+ }
+--- 679,692 ----
+
+ /*
+ * Return TRUE if "str[len]" matches with match->cp_str, considering
+! * match->cp_flags.
+ */
+ static int
+ ins_compl_equal(compl_T *match, char_u *str, int len)
+ {
+! if (match->cp_flags & CP_EQUAL)
+ return TRUE;
+! if (match->cp_flags & CP_ICASE)
+ return STRNICMP(match->cp_str, str, (size_t)len) == 0;
+ return STRNCMP(match->cp_str, str, (size_t)len) == 0;
+ }
+***************
+*** 734,741 ****
+ c1 = *p;
+ c2 = *s;
+ }
+! if (match->cp_icase ? (MB_TOLOWER(c1) != MB_TOLOWER(c2))
+! : (c1 != c2))
+ break;
+ if (has_mbyte)
+ {
+--- 736,743 ----
+ c1 = *p;
+ c2 = *s;
+ }
+! if ((match->cp_flags & CP_ICASE)
+! ? (MB_TOLOWER(c1) != MB_TOLOWER(c2)) : (c1 != c2))
+ break;
+ if (has_mbyte)
+ {
+***************
+*** 783,790 ****
+ int dir = compl_direction;
+
+ for (i = 0; i < num_matches && add_r != FAIL; i++)
+! if ((add_r = ins_compl_add(matches[i], -1, icase,
+! NULL, NULL, dir, 0, FALSE, FALSE)) == OK)
+ // if dir was BACKWARD then honor it just once
+ dir = FORWARD;
+ FreeWild(num_matches, matches);
+--- 785,792 ----
+ int dir = compl_direction;
+
+ for (i = 0; i < num_matches && add_r != FAIL; i++)
+! if ((add_r = ins_compl_add(matches[i], -1, NULL, NULL, dir,
+! icase ? CP_ICASE : 0, FALSE)) == OK)
+ // if dir was BACKWARD then honor it just once
+ dir = FORWARD;
+ FreeWild(num_matches, matches);
+***************
+*** 861,866 ****
+--- 863,869 ----
+ {
+ int save_w_wrow = curwin->w_wrow;
+ int save_w_leftcol = curwin->w_leftcol;
++ int flags = CP_ORIGINAL_TEXT;
+
+ // If already doing completions stop it.
+ if (ctrl_x_mode != CTRL_X_NORMAL)
+***************
+*** 875,882 ****
+ compl_length = (int)curwin->w_cursor.col - (int)startcol;
+ // compl_pattern doesn't need to be set
+ compl_orig_text = vim_strnsave(ml_get_curline() + compl_col, compl_length);
+ if (compl_orig_text == NULL || ins_compl_add(compl_orig_text,
+! -1, p_ic, NULL, NULL, 0, ORIGINAL_TEXT, FALSE, FALSE) != OK)
+ return;
+
+ ctrl_x_mode = CTRL_X_EVAL;
+--- 878,887 ----
+ compl_length = (int)curwin->w_cursor.col - (int)startcol;
+ // compl_pattern doesn't need to be set
+ compl_orig_text = vim_strnsave(ml_get_curline() + compl_col, compl_length);
++ if (p_ic)
++ flags |= CP_ICASE;
+ if (compl_orig_text == NULL || ins_compl_add(compl_orig_text,
+! -1, NULL, NULL, 0, flags, FALSE) != OK)
+ return;
+
+ ctrl_x_mode = CTRL_X_EVAL;
+***************
+*** 979,985 ****
+ do
+ {
+ if (compl == NULL
+! || ((compl->cp_flags & ORIGINAL_TEXT) == 0 && ++i == 2))
+ break;
+ compl = compl->cp_next;
+ } while (compl != compl_first_match);
+--- 984,990 ----
+ do
+ {
+ if (compl == NULL
+! || ((compl->cp_flags & CP_ORIGINAL_TEXT) == 0 && ++i == 2))
+ break;
+ compl = compl->cp_next;
+ } while (compl != compl_first_match);
+***************
+*** 1025,1031 ****
+ lead_len = (int)STRLEN(compl_leader);
+ do
+ {
+! if ((compl->cp_flags & ORIGINAL_TEXT) == 0
+ && (compl_leader == NULL
+ || ins_compl_equal(compl, compl_leader, lead_len)))
+ ++compl_match_arraysize;
+--- 1030,1036 ----
+ lead_len = (int)STRLEN(compl_leader);
+ do
+ {
+! if ((compl->cp_flags & CP_ORIGINAL_TEXT) == 0
+ && (compl_leader == NULL
+ || ins_compl_equal(compl, compl_leader, lead_len)))
+ ++compl_match_arraysize;
+***************
+*** 1040,1053 ****
+ {
+ // If the current match is the original text don't find the first
+ // match after it, don't highlight anything.
+! if (compl_shown_match->cp_flags & ORIGINAL_TEXT)
+ shown_match_ok = TRUE;
+
+ i = 0;
+ compl = compl_first_match;
+ do
+ {
+! if ((compl->cp_flags & ORIGINAL_TEXT) == 0
+ && (compl_leader == NULL
+ || ins_compl_equal(compl, compl_leader, lead_len)))
+ {
+--- 1045,1058 ----
+ {
+ // If the current match is the original text don't find the first
+ // match after it, don't highlight anything.
+! if (compl_shown_match->cp_flags & CP_ORIGINAL_TEXT)
+ shown_match_ok = TRUE;
+
+ i = 0;
+ compl = compl_first_match;
+ do
+ {
+! if ((compl->cp_flags & CP_ORIGINAL_TEXT) == 0
+ && (compl_leader == NULL
+ || ins_compl_equal(compl, compl_leader, lead_len)))
+ {
+***************
+*** 1088,1094 ****
+
+ // When the original text is the shown match don't set
+ // compl_shown_match.
+! if (compl->cp_flags & ORIGINAL_TEXT)
+ shown_match_ok = TRUE;
+
+ if (!shown_match_ok && shown_compl != NULL)
+--- 1093,1099 ----
+
+ // When the original text is the shown match don't set
+ // compl_shown_match.
+! if (compl->cp_flags & CP_ORIGINAL_TEXT)
+ shown_match_ok = TRUE;
+
+ if (!shown_match_ok && shown_compl != NULL)
+***************
+*** 1307,1313 ****
+ ptr = find_word_end(ptr);
+ add_r = ins_compl_add_infercase(regmatch->startp[0],
+ (int)(ptr - regmatch->startp[0]),
+! p_ic, files[i], *dir, 0);
+ if (thesaurus)
+ {
+ char_u *wstart;
+--- 1312,1318 ----
+ ptr = find_word_end(ptr);
+ add_r = ins_compl_add_infercase(regmatch->startp[0],
+ (int)(ptr - regmatch->startp[0]),
+! p_ic, files[i], *dir, FALSE);
+ if (thesaurus)
+ {
+ char_u *wstart;
+***************
+*** 1343,1349 ****
+ if (wstart != regmatch->startp[0])
+ add_r = ins_compl_add_infercase(wstart,
+ (int)(ptr - wstart),
+! p_ic, files[i], *dir, 0);
+ }
+ }
+ if (add_r == OK)
+--- 1348,1354 ----
+ if (wstart != regmatch->startp[0])
+ add_r = ins_compl_add_infercase(wstart,
+ (int)(ptr - wstart),
+! p_ic, files[i], *dir, FALSE);
+ }
+ }
+ if (add_r == OK)
+***************
+*** 1446,1452 ****
+ compl_curr_match = compl_curr_match->cp_next;
+ vim_free(match->cp_str);
+ // several entries may use the same fname, free it just once.
+! if (match->cp_flags & FREE_FNAME)
+ vim_free(match->cp_fname);
+ for (i = 0; i < CPT_COUNT; ++i)
+ vim_free(match->cp_text[i]);
+--- 1451,1457 ----
+ compl_curr_match = compl_curr_match->cp_next;
+ vim_free(match->cp_str);
+ // several entries may use the same fname, free it just once.
+! if (match->cp_flags & CP_FREE_FNAME)
+ vim_free(match->cp_fname);
+ for (i = 0; i < CPT_COUNT; ++i)
+ vim_free(match->cp_text[i]);
+***************
+*** 1540,1546 ****
+ match = compl_first_match;
+ do
+ {
+! if (!(match->cp_flags & ORIGINAL_TEXT))
+ {
+ di = dict_alloc();
+ if (di == NULL)
+--- 1545,1551 ----
+ match = compl_first_match;
+ do
+ {
+! if (!(match->cp_flags & CP_ORIGINAL_TEXT))
+ {
+ di = dict_alloc();
+ if (di == NULL)
+***************
+*** 1818,1826 ****
+ char_u *p;
+
+ // Replace the original text entry.
+! // The ORIGINAL_TEXT flag is either at the first item or might possibly be
+ // at the last item for backward completion
+! if (compl_first_match->cp_flags & ORIGINAL_TEXT) // safety check
+ {
+ p = vim_strsave(str);
+ if (p != NULL)
+--- 1823,1831 ----
+ char_u *p;
+
+ // Replace the original text entry.
+! // The CP_ORIGINAL_TEXT flag is either at the first item or might possibly be
+ // at the last item for backward completion
+! if (compl_first_match->cp_flags & CP_ORIGINAL_TEXT) // safety check
+ {
+ p = vim_strsave(str);
+ if (p != NULL)
+***************
+*** 1830,1836 ****
+ }
+ }
+ else if (compl_first_match->cp_prev != NULL
+! && (compl_first_match->cp_prev->cp_flags & ORIGINAL_TEXT))
+ {
+ p = vim_strsave(str);
+ if (p != NULL)
+--- 1835,1841 ----
+ }
+ }
+ else if (compl_first_match->cp_prev != NULL
+! && (compl_first_match->cp_prev->cp_flags & CP_ORIGINAL_TEXT))
+ {
+ p = vim_strsave(str);
+ if (p != NULL)
+***************
+*** 1858,1864 ****
+ {
+ // When still at the original match use the first entry that matches
+ // the leader.
+! if (compl_shown_match->cp_flags & ORIGINAL_TEXT)
+ {
+ p = NULL;
+ for (cp = compl_shown_match->cp_next; cp != NULL
+--- 1863,1869 ----
+ {
+ // When still at the original match use the first entry that matches
+ // the leader.
+! if (compl_shown_match->cp_flags & CP_ORIGINAL_TEXT)
+ {
+ p = NULL;
+ for (cp = compl_shown_match->cp_next; cp != NULL
+***************
+*** 2370,2379 ****
+ ins_compl_add_tv(typval_T *tv, int dir)
+ {
+ char_u *word;
+! int icase = FALSE;
+! int adup = FALSE;
+! int aempty = FALSE;
+! int aequal = FALSE;
+ char_u *(cptext[CPT_COUNT]);
+
+ if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL)
+--- 2375,2383 ----
+ ins_compl_add_tv(typval_T *tv, int dir)
+ {
+ char_u *word;
+! int dup = FALSE;
+! int empty = FALSE;
+! int flags = 0;
+ char_u *(cptext[CPT_COUNT]);
+
+ if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL)
+***************
+*** 2389,2411 ****
+ (char_u *)"info", FALSE);
+ cptext[CPT_USER_DATA] = dict_get_string(tv->vval.v_dict,
+ (char_u *)"user_data", FALSE);
+! if (dict_get_string(tv->vval.v_dict, (char_u *)"icase", FALSE) != NULL)
+! icase = dict_get_number(tv->vval.v_dict, (char_u *)"icase");
+ if (dict_get_string(tv->vval.v_dict, (char_u *)"dup", FALSE) != NULL)
+! adup = dict_get_number(tv->vval.v_dict, (char_u *)"dup");
+ if (dict_get_string(tv->vval.v_dict, (char_u *)"empty", FALSE) != NULL)
+! aempty = dict_get_number(tv->vval.v_dict, (char_u *)"empty");
+! if (dict_get_string(tv->vval.v_dict, (char_u *)"equal", FALSE) != NULL)
+! aequal = dict_get_number(tv->vval.v_dict, (char_u *)"equal");
+ }
+ else
+ {
+ word = tv_get_string_chk(tv);
+ vim_memset(cptext, 0, sizeof(cptext));
+ }
+! if (word == NULL || (!aempty && *word == NUL))
+ return FAIL;
+! return ins_compl_add(word, -1, icase, NULL, cptext, dir, 0, adup, aequal);
+ }
+ #endif
+
+--- 2393,2417 ----
+ (char_u *)"info", FALSE);
+ cptext[CPT_USER_DATA] = dict_get_string(tv->vval.v_dict,
+ (char_u *)"user_data", FALSE);
+! if (dict_get_string(tv->vval.v_dict, (char_u *)"icase", FALSE) != NULL
+! && dict_get_number(tv->vval.v_dict, (char_u *)"icase"))
+! flags |= CP_ICASE;
+ if (dict_get_string(tv->vval.v_dict, (char_u *)"dup", FALSE) != NULL)
+! dup = dict_get_number(tv->vval.v_dict, (char_u *)"dup");
+ if (dict_get_string(tv->vval.v_dict, (char_u *)"empty", FALSE) != NULL)
+! empty = dict_get_number(tv->vval.v_dict, (char_u *)"empty");
+! if (dict_get_string(tv->vval.v_dict, (char_u *)"equal", FALSE) != NULL
+! && dict_get_number(tv->vval.v_dict, (char_u *)"equal"))
+! flags |= CP_EQUAL;
+ }
+ else
+ {
+ word = tv_get_string_chk(tv);
+ vim_memset(cptext, 0, sizeof(cptext));
+ }
+! if (word == NULL || (!empty && *word == NUL))
+ return FAIL;
+! return ins_compl_add(word, -1, NULL, cptext, dir, flags, dup);
+ }
+ #endif
+
+***************
+*** 2672,2678 ****
+ p_ws = TRUE;
+ for (;;)
+ {
+! int flags = 0;
+
+ ++msg_silent; // Don't want messages for wrapscan.
+
+--- 2678,2684 ----
+ p_ws = TRUE;
+ for (;;)
+ {
+! int cont_s_ipos = FALSE;
+
+ ++msg_silent; // Don't want messages for wrapscan.
+
+***************
+*** 2778,2784 ****
+ tmp_ptr = ptr + IOSIZE - len - 1;
+ STRNCPY(IObuff + len, ptr, tmp_ptr - ptr);
+ len += (int)(tmp_ptr - ptr);
+! flags |= CONT_S_IPOS;
+ }
+ IObuff[len] = NUL;
+ ptr = IObuff;
+--- 2784,2790 ----
+ tmp_ptr = ptr + IOSIZE - len - 1;
+ STRNCPY(IObuff + len, ptr, tmp_ptr - ptr);
+ len += (int)(tmp_ptr - ptr);
+! cont_s_ipos = TRUE;
+ }
+ IObuff[len] = NUL;
+ ptr = IObuff;
+***************
+*** 2789,2795 ****
+ }
+ if (ins_compl_add_infercase(ptr, len, p_ic,
+ ins_buf == curbuf ? NULL : ins_buf->b_sfname,
+! 0, flags) != NOTDONE)
+ {
+ found_new_match = OK;
+ break;
+--- 2795,2801 ----
+ }
+ if (ins_compl_add_infercase(ptr, len, p_ic,
+ ins_buf == curbuf ? NULL : ins_buf->b_sfname,
+! 0, cont_s_ipos) != NOTDONE)
+ {
+ found_new_match = OK;
+ break;
+***************
+*** 2889,2895 ****
+ dict_T *dict;
+
+ ins_bytes(compl_shown_match->cp_str + ins_compl_len());
+! if (compl_shown_match->cp_flags & ORIGINAL_TEXT)
+ compl_used_match = FALSE;
+ else
+ compl_used_match = TRUE;
+--- 2895,2901 ----
+ dict_T *dict;
+
+ ins_bytes(compl_shown_match->cp_str + ins_compl_len());
+! if (compl_shown_match->cp_flags & CP_ORIGINAL_TEXT)
+ compl_used_match = FALSE;
+ else
+ compl_used_match = TRUE;
+***************
+*** 2949,2955 ****
+ return -1;
+
+ if (compl_leader != NULL
+! && (compl_shown_match->cp_flags & ORIGINAL_TEXT) == 0)
+ {
+ // Set "compl_shown_match" to the actually shown match, it may differ
+ // when "compl_leader" is used to omit some of the matches.
+--- 2955,2961 ----
+ return -1;
+
+ if (compl_leader != NULL
+! && (compl_shown_match->cp_flags & CP_ORIGINAL_TEXT) == 0)
+ {
+ // Set "compl_shown_match" to the actually shown match, it may differ
+ // when "compl_leader" is used to omit some of the matches.
+***************
+*** 3053,3059 ****
+ }
+ found_end = FALSE;
+ }
+! if ((compl_shown_match->cp_flags & ORIGINAL_TEXT) == 0
+ && compl_leader != NULL
+ && !ins_compl_equal(compl_shown_match,
+ compl_leader, (int)STRLEN(compl_leader)))
+--- 3059,3065 ----
+ }
+ found_end = FALSE;
+ }
+! if ((compl_shown_match->cp_flags & CP_ORIGINAL_TEXT) == 0
+ && compl_leader != NULL
+ && !ins_compl_equal(compl_shown_match,
+ compl_leader, (int)STRLEN(compl_leader)))
+***************
+*** 3304,3309 ****
+--- 3310,3316 ----
+ int save_w_leftcol;
+ int insert_match;
+ int save_did_ai = did_ai;
++ int flags = CP_ORIGINAL_TEXT;
+
+ compl_direction = ins_compl_key2dir(c);
+ insert_match = ins_compl_use_match(c);
+***************
+*** 3704,3711 ****
+ // Always add completion for the original text.
+ vim_free(compl_orig_text);
+ compl_orig_text = vim_strnsave(line + compl_col, compl_length);
+ if (compl_orig_text == NULL || ins_compl_add(compl_orig_text,
+! -1, p_ic, NULL, NULL, 0, ORIGINAL_TEXT, FALSE, FALSE) != OK)
+ {
+ VIM_CLEAR(compl_pattern);
+ VIM_CLEAR(compl_orig_text);
+--- 3711,3720 ----
+ // Always add completion for the original text.
+ vim_free(compl_orig_text);
+ compl_orig_text = vim_strnsave(line + compl_col, compl_length);
++ if (p_ic)
++ flags |= CP_ICASE;
+ if (compl_orig_text == NULL || ins_compl_add(compl_orig_text,
+! -1, NULL, NULL, 0, flags, FALSE) != OK)
+ {
+ VIM_CLEAR(compl_pattern);
+ VIM_CLEAR(compl_orig_text);
+***************
+*** 3767,3780 ****
+ compl_cont_status &= ~CONT_N_ADDS;
+ }
+
+! if (compl_curr_match->cp_flags & CONT_S_IPOS)
+ compl_cont_status |= CONT_S_IPOS;
+ else
+ compl_cont_status &= ~CONT_S_IPOS;
+
+ if (edit_submode_extra == NULL)
+ {
+! if (compl_curr_match->cp_flags & ORIGINAL_TEXT)
+ {
+ edit_submode_extra = (char_u *)_("Back at original");
+ edit_submode_highl = HLF_W;
+--- 3776,3789 ----
+ compl_cont_status &= ~CONT_N_ADDS;
+ }
+
+! if (compl_curr_match->cp_flags & CP_CONT_S_IPOS)
+ compl_cont_status |= CONT_S_IPOS;
+ else
+ compl_cont_status &= ~CONT_S_IPOS;
+
+ if (edit_submode_extra == NULL)
+ {
+! if (compl_curr_match->cp_flags & CP_ORIGINAL_TEXT)
+ {
+ edit_submode_extra = (char_u *)_("Back at original");
+ edit_submode_highl = HLF_W;
+*** ../vim-8.1.1123/src/proto/insexpand.pro 2019-03-30 13:53:26.174425093 +0100
+--- src/proto/insexpand.pro 2019-04-06 14:06:24.070288598 +0200
+***************
+*** 20,26 ****
+ int has_compl_option(int dict_opt);
+ int vim_is_ctrl_x_key(int c);
+ int ins_compl_accept_char(int c);
+! int ins_compl_add_infercase(char_u *str, int len, int icase, char_u *fname, int dir, int flags);
+ int ins_compl_has_shown_match(void);
+ int ins_compl_long_shown_match(void);
+ void completeopt_was_set(void);
+--- 20,26 ----
+ int has_compl_option(int dict_opt);
+ int vim_is_ctrl_x_key(int c);
+ int ins_compl_accept_char(int c);
+! int ins_compl_add_infercase(char_u *str_arg, int len, int icase, char_u *fname, int dir, int cont_s_ipos);
+ int ins_compl_has_shown_match(void);
+ int ins_compl_long_shown_match(void);
+ void completeopt_was_set(void);
+*** ../vim-8.1.1123/src/search.c 2019-03-30 13:53:26.174425093 +0100
+--- src/search.c 2019-04-06 13:52:12.762824629 +0200
+***************
+*** 5272,5278 ****
+ #ifdef FEAT_INS_EXPAND
+ if (action == ACTION_EXPAND)
+ {
+! int reuse = 0;
+ int add_r;
+ char_u *aux;
+
+--- 5272,5278 ----
+ #ifdef FEAT_INS_EXPAND
+ if (action == ACTION_EXPAND)
+ {
+! int cont_s_ipos = FALSE;
+ int add_r;
+ char_u *aux;
+
+***************
+*** 5333,5339 ****
+ p = aux + IOSIZE - i - 1;
+ STRNCPY(IObuff + i, aux, p - aux);
+ i += (int)(p - aux);
+! reuse |= CONT_S_IPOS;
+ }
+ IObuff[i] = NUL;
+ aux = IObuff;
+--- 5333,5339 ----
+ p = aux + IOSIZE - i - 1;
+ STRNCPY(IObuff + i, aux, p - aux);
+ i += (int)(p - aux);
+! cont_s_ipos = TRUE;
+ }
+ IObuff[i] = NUL;
+ aux = IObuff;
+***************
+*** 5344,5350 ****
+
+ add_r = ins_compl_add_infercase(aux, i, p_ic,
+ curr_fname == curbuf->b_fname ? NULL : curr_fname,
+! dir, reuse);
+ if (add_r == OK)
+ /* if dir was BACKWARD then honor it just once */
+ dir = FORWARD;
+--- 5344,5350 ----
+
+ add_r = ins_compl_add_infercase(aux, i, p_ic,
+ curr_fname == curbuf->b_fname ? NULL : curr_fname,
+! dir, cont_s_ipos);
+ if (add_r == OK)
+ /* if dir was BACKWARD then honor it just once */
+ dir = FORWARD;
+*** ../vim-8.1.1123/src/spell.c 2019-03-30 18:46:57.360077328 +0100
+--- src/spell.c 2019-04-06 13:52:21.666778351 +0200
+***************
+*** 8627,8633 ****
+ ? MB_STRNICMP(p, pat, STRLEN(pat)) == 0
+ : STRNCMP(p, pat, STRLEN(pat)) == 0)
+ && ins_compl_add_infercase(p, (int)STRLEN(p),
+! p_ic, NULL, *dir, 0) == OK)
+ /* if dir was BACKWARD then honor it just once */
+ *dir = FORWARD;
+ }
+--- 8627,8633 ----
+ ? MB_STRNICMP(p, pat, STRLEN(pat)) == 0
+ : STRNCMP(p, pat, STRLEN(pat)) == 0)
+ && ins_compl_add_infercase(p, (int)STRLEN(p),
+! p_ic, NULL, *dir, FALSE) == OK)
+ /* if dir was BACKWARD then honor it just once */
+ *dir = FORWARD;
+ }
+*** ../vim-8.1.1123/src/version.c 2019-04-06 13:45:51.568756943 +0200
+--- src/version.c 2019-04-06 14:19:37.271357326 +0200
+***************
+*** 773,774 ****
+--- 773,776 ----
+ { /* Add new patch number below this line */
++ /**/
++ 1124,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+211. Your husband leaves you...taking the computer with him and you
+ call him crying, and beg him to bring the computer back.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///