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