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