Blame SOURCES/7.4.455

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