073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.455
073263
Fcc: outbox
073263
From: Bram Moolenaar <Bram@moolenaar.net>
073263
Mime-Version: 1.0
073263
Content-Type: text/plain; charset=UTF-8
073263
Content-Transfer-Encoding: 8bit
073263
------------
073263
073263
Patch 7.4.455
073263
Problem:    Completion for :buf does not use 'wildignorecase'. (Akshay H)
073263
Solution:   Pass the 'wildignorecase' flag around.
073263
Files:	    src/buffer.c
073263
073263
073263
*** ../vim-7.4.454/src/buffer.c	2014-07-16 16:30:21.647608710 +0200
073263
--- src/buffer.c	2014-09-23 14:18:24.470789696 +0200
073263
***************
073263
*** 28,36 ****
073263
  #include "vim.h"
073263
  
073263
  #if defined(FEAT_CMDL_COMPL) || defined(FEAT_LISTCMDS) || defined(FEAT_EVAL) || defined(FEAT_PERL)
073263
! static char_u	*buflist_match __ARGS((regprog_T *prog, buf_T *buf));
073263
  # define HAVE_BUFLIST_MATCH
073263
! static char_u	*fname_match __ARGS((regprog_T *prog, char_u *name));
073263
  #endif
073263
  static void	buflist_setfpos __ARGS((buf_T *buf, win_T *win, linenr_T lnum, colnr_T col, int copy_options));
073263
  static wininfo_T *find_wininfo __ARGS((buf_T *buf, int skip_diff_buffer));
073263
--- 28,36 ----
073263
  #include "vim.h"
073263
  
073263
  #if defined(FEAT_CMDL_COMPL) || defined(FEAT_LISTCMDS) || defined(FEAT_EVAL) || defined(FEAT_PERL)
073263
! static char_u	*buflist_match __ARGS((regprog_T *prog, buf_T *buf, int ignore_case));
073263
  # define HAVE_BUFLIST_MATCH
073263
! static char_u	*fname_match __ARGS((regprog_T *prog, char_u *name, int ignore_case));
073263
  #endif
073263
  static void	buflist_setfpos __ARGS((buf_T *buf, win_T *win, linenr_T lnum, colnr_T col, int copy_options));
073263
  static wininfo_T *find_wininfo __ARGS((buf_T *buf, int skip_diff_buffer));
073263
***************
073263
*** 2282,2288 ****
073263
  #ifdef FEAT_DIFF
073263
  			    && (!diffmode || diff_mode_buf(buf))
073263
  #endif
073263
! 			    && buflist_match(prog, buf) != NULL)
073263
  		    {
073263
  			if (curtab_only)
073263
  			{
073263
--- 2282,2288 ----
073263
  #ifdef FEAT_DIFF
073263
  			    && (!diffmode || diff_mode_buf(buf))
073263
  #endif
073263
! 			    && buflist_match(prog, buf, FALSE) != NULL)
073263
  		    {
073263
  			if (curtab_only)
073263
  			{
073263
***************
073263
*** 2396,2402 ****
073263
  	    {
073263
  		if (!buf->b_p_bl)	/* skip unlisted buffers */
073263
  		    continue;
073263
! 		p = buflist_match(prog, buf);
073263
  		if (p != NULL)
073263
  		{
073263
  		    if (round == 1)
073263
--- 2396,2402 ----
073263
  	    {
073263
  		if (!buf->b_p_bl)	/* skip unlisted buffers */
073263
  		    continue;
073263
! 		p = buflist_match(prog, buf, p_wic);
073263
  		if (p != NULL)
073263
  		{
073263
  		    if (round == 1)
073263
***************
073263
*** 2444,2459 ****
073263
   * Check for a match on the file name for buffer "buf" with regprog "prog".
073263
   */
073263
      static char_u *
073263
! buflist_match(prog, buf)
073263
      regprog_T	*prog;
073263
      buf_T	*buf;
073263
  {
073263
      char_u	*match;
073263
  
073263
      /* First try the short file name, then the long file name. */
073263
!     match = fname_match(prog, buf->b_sfname);
073263
      if (match == NULL)
073263
! 	match = fname_match(prog, buf->b_ffname);
073263
  
073263
      return match;
073263
  }
073263
--- 2444,2460 ----
073263
   * Check for a match on the file name for buffer "buf" with regprog "prog".
073263
   */
073263
      static char_u *
073263
! buflist_match(prog, buf, ignore_case)
073263
      regprog_T	*prog;
073263
      buf_T	*buf;
073263
+     int		ignore_case;  /* when TRUE ignore case, when FALSE use 'fic' */
073263
  {
073263
      char_u	*match;
073263
  
073263
      /* First try the short file name, then the long file name. */
073263
!     match = fname_match(prog, buf->b_sfname, ignore_case);
073263
      if (match == NULL)
073263
! 	match = fname_match(prog, buf->b_ffname, ignore_case);
073263
  
073263
      return match;
073263
  }
073263
***************
073263
*** 2463,2471 ****
073263
   * Return "name" when there is a match, NULL when not.
073263
   */
073263
      static char_u *
073263
! fname_match(prog, name)
073263
      regprog_T	*prog;
073263
      char_u	*name;
073263
  {
073263
      char_u	*match = NULL;
073263
      char_u	*p;
073263
--- 2464,2473 ----
073263
   * Return "name" when there is a match, NULL when not.
073263
   */
073263
      static char_u *
073263
! fname_match(prog, name, ignore_case)
073263
      regprog_T	*prog;
073263
      char_u	*name;
073263
+     int		ignore_case;  /* when TRUE ignore case, when FALSE use 'fic' */
073263
  {
073263
      char_u	*match = NULL;
073263
      char_u	*p;
073263
***************
073263
*** 2474,2480 ****
073263
      if (name != NULL)
073263
      {
073263
  	regmatch.regprog = prog;
073263
! 	regmatch.rm_ic = p_fic;	/* ignore case when 'fileignorecase' is set */
073263
  	if (vim_regexec(&regmatch, name, (colnr_T)0))
073263
  	    match = name;
073263
  	else
073263
--- 2476,2483 ----
073263
      if (name != NULL)
073263
      {
073263
  	regmatch.regprog = prog;
073263
! 	/* Ignore case when 'fileignorecase' or the argument is set. */
073263
! 	regmatch.rm_ic = p_fic || ignore_case;
073263
  	if (vim_regexec(&regmatch, name, (colnr_T)0))
073263
  	    match = name;
073263
  	else
073263
*** ../vim-7.4.454/src/version.c	2014-09-23 13:48:40.054785798 +0200
073263
--- src/version.c	2014-09-23 14:19:13.114789802 +0200
073263
***************
073263
*** 743,744 ****
073263
--- 743,746 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     455,
073263
  /**/
073263
073263
-- 
073263
If Microsoft would build a car...
073263
... the oil, water temperature, and alternator warning lights would
073263
all be replaced by a single "General Protection Fault" warning light.
073263
073263
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
073263
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
073263
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
073263
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///