diff src/eval.c @ 7627:d9ec7d22494d v7.4.1113

commit https://github.com/vim/vim/commit/4119cf80e1e534057680f9543e73edf7967c2440 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 17 14:59:01 2016 +0100 patch 7.4.1113 Problem: Using {ns} in variable name does not work. (lilydjwg) Solution: Fix recognizing colon. Add a test.
author Christian Brabandt <cb@256bit.org>
date Sun, 17 Jan 2016 15:00:05 +0100
parents 228ff048db20
children befbed72da87
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -20844,10 +20844,10 @@ find_name_end(arg, expr_start, expr_end,
 	else if (br_nest == 0 && mb_nest == 0 && *p == ':')
 	{
 	    /* "s:" is start of "s:var", but "n:" is not and can be used in
-	     * slice "[n:]".  Also "xx:" is not a namespace. */
+	     * slice "[n:]".  Also "xx:" is not a namespace. But {ns}: is. */
 	    len = (int)(p - arg);
 	    if ((len == 1 && vim_strchr(NAMESPACE_CHAR, *arg) == NULL)
-		    || len > 1)
+		    || (len > 1 && p[-1] != '}'))
 		break;
 	}