659d752
To: vim_dev@googlegroups.com
659d752
Subject: Patch 7.3.065
659d752
Fcc: outbox
659d752
From: Bram Moolenaar <Bram@moolenaar.net>
659d752
Mime-Version: 1.0
659d752
Content-Type: text/plain; charset=UTF-8
659d752
Content-Transfer-Encoding: 8bit
659d752
------------
659d752
659d752
Patch 7.3.065
659d752
Problem:    Can't get current line number in a source file.
659d752
Solution:   Add the <slnum> item, similar to <sfile>.
659d752
Files:	    src/ex_docmd.c
659d752
659d752
659d752
*** ../vim-7.3.064/src/ex_docmd.c	2010-11-16 11:29:30.000000000 +0100
659d752
--- src/ex_docmd.c	2010-11-24 15:41:51.000000000 +0100
659d752
***************
659d752
*** 9538,9554 ****
659d752
  #define SPEC_CFILE  4
659d752
  		    "<sfile>",		/* ":so" file name */
659d752
  #define SPEC_SFILE  5
659d752
  #ifdef FEAT_AUTOCMD
659d752
  		    "<afile>",		/* autocommand file name */
659d752
! # define SPEC_AFILE 6
659d752
  		    "<abuf>",		/* autocommand buffer number */
659d752
! # define SPEC_ABUF  7
659d752
  		    "<amatch>",		/* autocommand match name */
659d752
! # define SPEC_AMATCH 8
659d752
  #endif
659d752
  #ifdef FEAT_CLIENTSERVER
659d752
  		    "<client>"
659d752
! # define SPEC_CLIENT 9
659d752
  #endif
659d752
      };
659d752
  
659d752
--- 9538,9560 ----
659d752
  #define SPEC_CFILE  4
659d752
  		    "<sfile>",		/* ":so" file name */
659d752
  #define SPEC_SFILE  5
659d752
+ 		    "<slnum>",		/* ":so" file line number */
659d752
+ #define SPEC_SLNUM  6
659d752
  #ifdef FEAT_AUTOCMD
659d752
  		    "<afile>",		/* autocommand file name */
659d752
! # define SPEC_AFILE 7
659d752
  		    "<abuf>",		/* autocommand buffer number */
659d752
! # define SPEC_ABUF  8
659d752
  		    "<amatch>",		/* autocommand match name */
659d752
! # define SPEC_AMATCH 9
659d752
  #endif
659d752
  #ifdef FEAT_CLIENTSERVER
659d752
  		    "<client>"
659d752
! # ifdef FEAT_AUTOCMD
659d752
! #  define SPEC_CLIENT 10
659d752
! # else
659d752
! #  define SPEC_CLIENT 7
659d752
! # endif
659d752
  #endif
659d752
      };
659d752
  
659d752
***************
659d752
*** 9573,9578 ****
659d752
--- 9579,9585 ----
659d752
   *	  '<cWORD>' to WORD under the cursor
659d752
   *	  '<cfile>' to path name under the cursor
659d752
   *	  '<sfile>' to sourced file name
659d752
+  *	  '<slnum>' to sourced file line number
659d752
   *	  '<afile>' to file name for autocommand
659d752
   *	  '<abuf>'  to buffer number for autocommand
659d752
   *	  '<amatch>' to matching name for autocommand
659d752
***************
659d752
*** 9604,9613 ****
659d752
  #ifdef FEAT_MODIFY_FNAME
659d752
      int		skip_mod = FALSE;
659d752
  #endif
659d752
- 
659d752
- #if defined(FEAT_AUTOCMD) || defined(FEAT_CLIENTSERVER)
659d752
      char_u	strbuf[30];
659d752
- #endif
659d752
  
659d752
      *errormsg = NULL;
659d752
      if (escaped != NULL)
659d752
--- 9611,9617 ----
659d752
***************
659d752
*** 9796,9801 ****
659d752
--- 9800,9814 ----
659d752
  		    return NULL;
659d752
  		}
659d752
  		break;
659d752
+ 	case SPEC_SLNUM:	/* line in file for ":so" command */
659d752
+ 		if (sourcing_name == NULL || sourcing_lnum == 0)
659d752
+ 		{
659d752
+ 		    *errormsg = (char_u *)_("E842: no line number to use for \"<slnum>\"");
659d752
+ 		    return NULL;
659d752
+ 		}
659d752
+ 		sprintf((char *)strbuf, "%ld", (long)sourcing_lnum);
659d752
+ 		result = strbuf;
659d752
+ 		break;
659d752
  #if defined(FEAT_CLIENTSERVER)
659d752
  	case SPEC_CLIENT:	/* Source of last submitted input */
659d752
  		sprintf((char *)strbuf, PRINTF_HEX_LONG_U,
659d752
*** ../vim-7.3.064/src/version.c	2010-11-24 14:28:53.000000000 +0100
659d752
--- src/version.c	2010-11-24 15:49:57.000000000 +0100
659d752
***************
659d752
*** 716,717 ****
659d752
--- 716,719 ----
659d752
  {   /* Add new patch number below this line */
659d752
+ /**/
659d752
+     65,
659d752
  /**/
659d752
659d752
659d752
-- 
659d752
If you don't get everything you want, think of
659d752
everything you didn't get and don't want.
659d752
659d752
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
659d752
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
659d752
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
659d752
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///