From 4dbbff57baebde02a8bdb26a25947c3964ec6198 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 24 Nov 2010 15:50:59 +0100 Subject: updated for version 7.3.065 Problem: Can't get current line number in a source file. Solution: Add the item, similar to . --- src/ex_docmd.c | 27 ++++++++++++++++++++------- src/version.c | 2 ++ 2 files changed, 22 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/ex_docmd.c b/src/ex_docmd.c index ee6c29701..0aac8f85c 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -9538,17 +9538,23 @@ find_cmdline_var(src, usedlen) #define SPEC_CFILE 4 "", /* ":so" file name */ #define SPEC_SFILE 5 + "", /* ":so" file line number */ +#define SPEC_SLNUM 6 #ifdef FEAT_AUTOCMD "", /* autocommand file name */ -# define SPEC_AFILE 6 +# define SPEC_AFILE 7 "", /* autocommand buffer number */ -# define SPEC_ABUF 7 +# define SPEC_ABUF 8 "", /* autocommand match name */ -# define SPEC_AMATCH 8 +# define SPEC_AMATCH 9 #endif #ifdef FEAT_CLIENTSERVER "" -# define SPEC_CLIENT 9 +# ifdef FEAT_AUTOCMD +# define SPEC_CLIENT 10 +# else +# define SPEC_CLIENT 7 +# endif #endif }; @@ -9573,6 +9579,7 @@ find_cmdline_var(src, usedlen) * '' to WORD under the cursor * '' to path name under the cursor * '' to sourced file name + * '' to sourced file line number * '' to file name for autocommand * '' to buffer number for autocommand * '' to matching name for autocommand @@ -9604,10 +9611,7 @@ eval_vars(src, srcstart, usedlen, lnump, errormsg, escaped) #ifdef FEAT_MODIFY_FNAME int skip_mod = FALSE; #endif - -#if defined(FEAT_AUTOCMD) || defined(FEAT_CLIENTSERVER) char_u strbuf[30]; -#endif *errormsg = NULL; if (escaped != NULL) @@ -9796,6 +9800,15 @@ eval_vars(src, srcstart, usedlen, lnump, errormsg, escaped) return NULL; } break; + case SPEC_SLNUM: /* line in file for ":so" command */ + if (sourcing_name == NULL || sourcing_lnum == 0) + { + *errormsg = (char_u *)_("E842: no line number to use for \"\""); + return NULL; + } + sprintf((char *)strbuf, "%ld", (long)sourcing_lnum); + result = strbuf; + break; #if defined(FEAT_CLIENTSERVER) case SPEC_CLIENT: /* Source of last submitted input */ sprintf((char *)strbuf, PRINTF_HEX_LONG_U, diff --git a/src/version.c b/src/version.c index df30ef81f..e334d0a36 100644 --- a/src/version.c +++ b/src/version.c @@ -714,6 +714,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 65, /**/ 64, /**/ -- cgit v1.2.1