1a1ca1a
To: vim-dev@vim.org
1a1ca1a
Subject: Patch 7.2.026
1a1ca1a
Fcc: outbox
1a1ca1a
From: Bram Moolenaar <Bram@moolenaar.net>
1a1ca1a
Mime-Version: 1.0
1a1ca1a
Content-Type: text/plain; charset=ISO-8859-1
1a1ca1a
Content-Transfer-Encoding: 8bit
1a1ca1a
------------
1a1ca1a
1a1ca1a
Patch 7.2.026 (after 7.2.010)
1a1ca1a
Problem:    "K" doesn't use the length of the identifier but uses the rest of
1a1ca1a
	    the line.
1a1ca1a
Solution:   Copy the desired number of characters first.
1a1ca1a
Files:	    src/normal.c
1a1ca1a
1a1ca1a
1a1ca1a
*** ../vim-7.2.025/src/normal.c	Thu Oct  2 22:55:17 2008
1a1ca1a
--- src/normal.c	Sat Nov  1 13:41:03 2008
1a1ca1a
***************
1a1ca1a
*** 183,188 ****
1a1ca1a
--- 183,190 ----
1a1ca1a
  static void	nv_cursorhold __ARGS((cmdarg_T *cap));
1a1ca1a
  #endif
1a1ca1a
  
1a1ca1a
+ static char *e_noident = N_("E349: No identifier under cursor");
1a1ca1a
+ 
1a1ca1a
  /*
1a1ca1a
   * Function to be called for a Normal or Visual mode command.
1a1ca1a
   * The argument is a cmdarg_T.
1a1ca1a
***************
1a1ca1a
*** 3510,3516 ****
1a1ca1a
  	if (find_type & FIND_STRING)
1a1ca1a
  	    EMSG(_("E348: No string under cursor"));
1a1ca1a
  	else
1a1ca1a
! 	    EMSG(_("E349: No identifier under cursor"));
1a1ca1a
  	return 0;
1a1ca1a
      }
1a1ca1a
      ptr += col;
1a1ca1a
--- 3512,3518 ----
1a1ca1a
  	if (find_type & FIND_STRING)
1a1ca1a
  	    EMSG(_("E348: No string under cursor"));
1a1ca1a
  	else
1a1ca1a
! 	    EMSG(_(e_noident));
1a1ca1a
  	return 0;
1a1ca1a
      }
1a1ca1a
      ptr += col;
1a1ca1a
***************
1a1ca1a
*** 5472,5479 ****
1a1ca1a
  	    {
1a1ca1a
  		/* An external command will probably use an argument starting
1a1ca1a
  		 * with "-" as an option.  To avoid trouble we skip the "-". */
1a1ca1a
! 		while (*ptr == '-')
1a1ca1a
  		    ++ptr;
1a1ca1a
  
1a1ca1a
  		/* When a count is given, turn it into a range.  Is this
1a1ca1a
  		 * really what we want? */
1a1ca1a
--- 5474,5490 ----
1a1ca1a
  	    {
1a1ca1a
  		/* An external command will probably use an argument starting
1a1ca1a
  		 * with "-" as an option.  To avoid trouble we skip the "-". */
1a1ca1a
! 		while (*ptr == '-' && n > 0)
1a1ca1a
! 		{
1a1ca1a
  		    ++ptr;
1a1ca1a
+ 		    --n;
1a1ca1a
+ 		}
1a1ca1a
+ 		if (n == 0)
1a1ca1a
+ 		{
1a1ca1a
+ 		    EMSG(_(e_noident));	 /* found dashes only */
1a1ca1a
+ 		    vim_free(buf);
1a1ca1a
+ 		    return;
1a1ca1a
+ 		}
1a1ca1a
  
1a1ca1a
  		/* When a count is given, turn it into a range.  Is this
1a1ca1a
  		 * really what we want? */
1a1ca1a
***************
1a1ca1a
*** 5520,5526 ****
1a1ca1a
--- 5531,5539 ----
1a1ca1a
      if (cmdchar == 'K' && !kp_help)
1a1ca1a
      {
1a1ca1a
  	/* Escape the argument properly for a shell command */
1a1ca1a
+ 	ptr = vim_strnsave(ptr, n);
1a1ca1a
  	p = vim_strsave_shellescape(ptr, TRUE);
1a1ca1a
+ 	vim_free(ptr);
1a1ca1a
  	if (p == NULL)
1a1ca1a
  	{
1a1ca1a
  	    vim_free(buf);
1a1ca1a
*** ../vim-7.2.025/src/version.c	Thu Oct  2 22:55:17 2008
1a1ca1a
--- src/version.c	Sat Nov  1 13:50:53 2008
1a1ca1a
***************
1a1ca1a
*** 678,679 ****
1a1ca1a
--- 678,681 ----
1a1ca1a
  {   /* Add new patch number below this line */
1a1ca1a
+ /**/
1a1ca1a
+     26,
1a1ca1a
  /**/
1a1ca1a
1a1ca1a
-- 
1a1ca1a
hundred-and-one symptoms of being an internet addict:
1a1ca1a
161. You get up before the sun rises to check your e-mail, and you
1a1ca1a
     find yourself in the very same chair long after the sun has set.
1a1ca1a
1a1ca1a
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
1a1ca1a
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
1a1ca1a
\\\        download, build and distribute -- http://www.A-A-P.org        ///
1a1ca1a
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///