7a5b072
To: vim-dev@vim.org
7a5b072
Subject: Patch 7.0.068
7a5b072
Fcc: outbox
7a5b072
From: Bram Moolenaar <Bram@moolenaar.net>
7a5b072
Mime-Version: 1.0
7a5b072
Content-Type: text/plain; charset=ISO-8859-1
7a5b072
Content-Transfer-Encoding: 8bit
7a5b072
------------
7a5b072
7a5b072
Patch 7.0.068
7a5b072
Problem:    When 'ignorecase' is set and using Insert mode completion,
7a5b072
	    typing characters to change the list of matches, case is not
7a5b072
	    ignored. (Hugo Ahlenius)
7a5b072
Solution:   Store the 'ignorecase' flag with the matches where needed.
7a5b072
Files:	    src/edit.c, src/search.c, src/spell.c
7a5b072
7a5b072
7a5b072
*** ../vim-7.0.067/src/edit.c	Tue Aug 29 16:10:54 2006
7a5b072
--- src/edit.c	Tue Aug 29 14:57:46 2006
7a5b072
***************
7a5b072
*** 2405,2411 ****
7a5b072
      /* compl_pattern doesn't need to be set */
7a5b072
      compl_orig_text = vim_strnsave(ml_get_curline() + compl_col, compl_length);
7a5b072
      if (compl_orig_text == NULL || ins_compl_add(compl_orig_text,
7a5b072
! 			-1, FALSE, NULL, NULL, 0, ORIGINAL_TEXT, FALSE) != OK)
7a5b072
  	return;
7a5b072
  
7a5b072
      /* Handle like dictionary completion. */
7a5b072
--- 2405,2411 ----
7a5b072
      /* compl_pattern doesn't need to be set */
7a5b072
      compl_orig_text = vim_strnsave(ml_get_curline() + compl_col, compl_length);
7a5b072
      if (compl_orig_text == NULL || ins_compl_add(compl_orig_text,
7a5b072
! 			-1, p_ic, NULL, NULL, 0, ORIGINAL_TEXT, FALSE) != OK)
7a5b072
  	return;
7a5b072
  
7a5b072
      /* Handle like dictionary completion. */
7a5b072
***************
7a5b072
*** 2821,2827 ****
7a5b072
  			ptr = find_word_end(ptr);
7a5b072
  		    add_r = ins_compl_add_infercase(regmatch->startp[0],
7a5b072
  					  (int)(ptr - regmatch->startp[0]),
7a5b072
! 						     FALSE, files[i], *dir, 0);
7a5b072
  		    if (thesaurus)
7a5b072
  		    {
7a5b072
  			char_u *wstart;
7a5b072
--- 2821,2827 ----
7a5b072
  			ptr = find_word_end(ptr);
7a5b072
  		    add_r = ins_compl_add_infercase(regmatch->startp[0],
7a5b072
  					  (int)(ptr - regmatch->startp[0]),
7a5b072
! 						     p_ic, files[i], *dir, 0);
7a5b072
  		    if (thesaurus)
7a5b072
  		    {
7a5b072
  			char_u *wstart;
7a5b072
***************
7a5b072
*** 2857,2863 ****
7a5b072
  				ptr = find_word_end(ptr);
7a5b072
  			    add_r = ins_compl_add_infercase(wstart,
7a5b072
  				    (int)(ptr - wstart),
7a5b072
! 				    FALSE, files[i], *dir, 0);
7a5b072
  			}
7a5b072
  		    }
7a5b072
  		    if (add_r == OK)
7a5b072
--- 2857,2863 ----
7a5b072
  				ptr = find_word_end(ptr);
7a5b072
  			    add_r = ins_compl_add_infercase(wstart,
7a5b072
  				    (int)(ptr - wstart),
7a5b072
! 				    p_ic, files[i], *dir, 0);
7a5b072
  			}
7a5b072
  		    }
7a5b072
  		    if (add_r == OK)
7a5b072
***************
7a5b072
*** 3826,3832 ****
7a5b072
  		    TAG_INS_COMP | (ctrl_x_mode ? TAG_VERBOSE : 0),
7a5b072
  		    TAG_MANY, curbuf->b_ffname) == OK && num_matches > 0)
7a5b072
  	    {
7a5b072
! 		ins_compl_add_matches(num_matches, matches, FALSE);
7a5b072
  	    }
7a5b072
  	    p_ic = save_p_ic;
7a5b072
  	    break;
7a5b072
--- 3826,3832 ----
7a5b072
  		    TAG_INS_COMP | (ctrl_x_mode ? TAG_VERBOSE : 0),
7a5b072
  		    TAG_MANY, curbuf->b_ffname) == OK && num_matches > 0)
7a5b072
  	    {
7a5b072
! 		ins_compl_add_matches(num_matches, matches, p_ic);
7a5b072
  	    }
7a5b072
  	    p_ic = save_p_ic;
7a5b072
  	    break;
7a5b072
***************
7a5b072
*** 3867,3873 ****
7a5b072
  	    num_matches = expand_spelling(first_match_pos.lnum,
7a5b072
  				 first_match_pos.col, compl_pattern, &matches);
7a5b072
  	    if (num_matches > 0)
7a5b072
! 		ins_compl_add_matches(num_matches, matches, FALSE);
7a5b072
  #endif
7a5b072
  	    break;
7a5b072
  
7a5b072
--- 3867,3873 ----
7a5b072
  	    num_matches = expand_spelling(first_match_pos.lnum,
7a5b072
  				 first_match_pos.col, compl_pattern, &matches);
7a5b072
  	    if (num_matches > 0)
7a5b072
! 		ins_compl_add_matches(num_matches, matches, p_ic);
7a5b072
  #endif
7a5b072
  	    break;
7a5b072
  
7a5b072
***************
7a5b072
*** 4001,4007 ****
7a5b072
  			    continue;
7a5b072
  		    }
7a5b072
  		}
7a5b072
! 		if (ins_compl_add_infercase(ptr, len, FALSE,
7a5b072
  				 ins_buf == curbuf ? NULL : ins_buf->b_sfname,
7a5b072
  					   0, flags) != NOTDONE)
7a5b072
  		{
7a5b072
--- 4001,4007 ----
7a5b072
  			    continue;
7a5b072
  		    }
7a5b072
  		}
7a5b072
! 		if (ins_compl_add_infercase(ptr, len, p_ic,
7a5b072
  				 ins_buf == curbuf ? NULL : ins_buf->b_sfname,
7a5b072
  					   0, flags) != NOTDONE)
7a5b072
  		{
7a5b072
***************
7a5b072
*** 4809,4815 ****
7a5b072
  	vim_free(compl_orig_text);
7a5b072
  	compl_orig_text = vim_strnsave(line + compl_col, compl_length);
7a5b072
  	if (compl_orig_text == NULL || ins_compl_add(compl_orig_text,
7a5b072
! 			-1, FALSE, NULL, NULL, 0, ORIGINAL_TEXT, FALSE) != OK)
7a5b072
  	{
7a5b072
  	    vim_free(compl_pattern);
7a5b072
  	    compl_pattern = NULL;
7a5b072
--- 4809,4815 ----
7a5b072
  	vim_free(compl_orig_text);
7a5b072
  	compl_orig_text = vim_strnsave(line + compl_col, compl_length);
7a5b072
  	if (compl_orig_text == NULL || ins_compl_add(compl_orig_text,
7a5b072
! 			-1, p_ic, NULL, NULL, 0, ORIGINAL_TEXT, FALSE) != OK)
7a5b072
  	{
7a5b072
  	    vim_free(compl_pattern);
7a5b072
  	    compl_pattern = NULL;
7a5b072
*** ../vim-7.0.067/src/search.c	Fri May  5 23:15:17 2006
7a5b072
--- src/search.c	Tue Aug 29 14:56:15 2006
7a5b072
***************
7a5b072
*** 4871,4877 ****
7a5b072
  			goto exit_matched;
7a5b072
  		}
7a5b072
  
7a5b072
! 		add_r = ins_compl_add_infercase(aux, i, FALSE,
7a5b072
  			curr_fname == curbuf->b_fname ? NULL : curr_fname,
7a5b072
  			dir, reuse);
7a5b072
  		if (add_r == OK)
7a5b072
--- 4876,4882 ----
7a5b072
  			goto exit_matched;
7a5b072
  		}
7a5b072
  
7a5b072
! 		add_r = ins_compl_add_infercase(aux, i, p_ic,
7a5b072
  			curr_fname == curbuf->b_fname ? NULL : curr_fname,
7a5b072
  			dir, reuse);
7a5b072
  		if (add_r == OK)
7a5b072
*** ../vim-7.0.067/src/spell.c	Sun Jul 23 21:52:16 2006
7a5b072
--- src/spell.c	Tue Aug 29 14:56:26 2006
7a5b072
***************
7a5b072
*** 15658,15664 ****
7a5b072
  		    ? MB_STRNICMP(p, pat, STRLEN(pat)) == 0
7a5b072
  		    : STRNCMP(p, pat, STRLEN(pat)) == 0)
7a5b072
  		&& ins_compl_add_infercase(p, (int)STRLEN(p),
7a5b072
! 					  FALSE, NULL, *dir, 0) == OK)
7a5b072
  	/* if dir was BACKWARD then honor it just once */
7a5b072
  	*dir = FORWARD;
7a5b072
  }
7a5b072
--- 15662,15668 ----
7a5b072
  		    ? MB_STRNICMP(p, pat, STRLEN(pat)) == 0
7a5b072
  		    : STRNCMP(p, pat, STRLEN(pat)) == 0)
7a5b072
  		&& ins_compl_add_infercase(p, (int)STRLEN(p),
7a5b072
! 					  p_ic, NULL, *dir, 0) == OK)
7a5b072
  	/* if dir was BACKWARD then honor it just once */
7a5b072
  	*dir = FORWARD;
7a5b072
  }
7a5b072
*** ../vim-7.0.067/src/version.c	Tue Aug 29 16:10:54 2006
7a5b072
--- src/version.c	Tue Aug 29 16:13:49 2006
7a5b072
***************
7a5b072
*** 668,669 ****
7a5b072
--- 668,671 ----
7a5b072
  {   /* Add new patch number below this line */
7a5b072
+ /**/
7a5b072
+     68,
7a5b072
  /**/
7a5b072
7a5b072
-- 
7a5b072
hundred-and-one symptoms of being an internet addict:
7a5b072
266. You hear most of your jokes via e-mail instead of in person.
7a5b072
7a5b072
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
7a5b072
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
7a5b072
\\\        download, build and distribute -- http://www.A-A-P.org        ///
7a5b072
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///