Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
7626:5d57c7117629 | 7627:d9ec7d22494d |
---|---|
20842 break; | 20842 break; |
20843 } | 20843 } |
20844 else if (br_nest == 0 && mb_nest == 0 && *p == ':') | 20844 else if (br_nest == 0 && mb_nest == 0 && *p == ':') |
20845 { | 20845 { |
20846 /* "s:" is start of "s:var", but "n:" is not and can be used in | 20846 /* "s:" is start of "s:var", but "n:" is not and can be used in |
20847 * slice "[n:]". Also "xx:" is not a namespace. */ | 20847 * slice "[n:]". Also "xx:" is not a namespace. But {ns}: is. */ |
20848 len = (int)(p - arg); | 20848 len = (int)(p - arg); |
20849 if ((len == 1 && vim_strchr(NAMESPACE_CHAR, *arg) == NULL) | 20849 if ((len == 1 && vim_strchr(NAMESPACE_CHAR, *arg) == NULL) |
20850 || len > 1) | 20850 || (len > 1 && p[-1] != '}')) |
20851 break; | 20851 break; |
20852 } | 20852 } |
20853 | 20853 |
20854 if (mb_nest == 0) | 20854 if (mb_nest == 0) |
20855 { | 20855 { |