diff options
author | Marco Hinz <mh.codebro+github@gmail.com> | 2017-11-09 02:20:12 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-11-09 02:20:12 +0100 |
commit | 9837a9c40105d3d28fc99d62693e47b32cec0f06 (patch) | |
tree | 524028d934e5c9a78e404a42c987b7f6a32d1be5 | |
parent | 55d8967147efbf1d0f3e2b5e13677ca4af9e2be4 (diff) | |
download | rneovim-9837a9c40105d3d28fc99d62693e47b32cec0f06.tar.gz rneovim-9837a9c40105d3d28fc99d62693e47b32cec0f06.tar.bz2 rneovim-9837a9c40105d3d28fc99d62693e47b32cec0f06.zip |
compat: "v:count" distinct from "count" (#7407)
-rw-r--r-- | runtime/doc/eval.txt | 1 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 2 | ||||
-rw-r--r-- | src/nvim/eval.c | 2 | ||||
-rw-r--r-- | test/functional/eval/special_vars_spec.lua | 7 |
4 files changed, 10 insertions, 2 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 24d704017f..11f549cd05 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1474,7 +1474,6 @@ v:count The count given for the last Normal mode command. Can be used When there are two counts, as in "3d2w", they are multiplied, just like what happens in the command, "d6w" for the example. Also used for evaluating the 'formatexpr' option. - "count" also works, for backwards compatibility. *v:count1* *count1-variable* v:count1 Just like "v:count", but defaults to one when no count is diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index d37b9be4e3..04393f5e44 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -298,6 +298,8 @@ Highlight groups: |hl-ColorColumn|, |hl-CursorColumn| are lower priority than most other groups +The variable name "count" is no fallback for |v:count| anymore. + ============================================================================== 5. Missing legacy features *nvim-features-missing* diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 9752851d4e..0c0c03c8ed 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -334,7 +334,7 @@ static struct vimvar { // VV_SEND_SERVER "servername" // VV_REG "register" // VV_OP "operator" - VV(VV_COUNT, "count", VAR_NUMBER, VV_COMPAT+VV_RO), + VV(VV_COUNT, "count", VAR_NUMBER, VV_RO), VV(VV_COUNT1, "count1", VAR_NUMBER, VV_RO), VV(VV_PREVCOUNT, "prevcount", VAR_NUMBER, VV_RO), VV(VV_ERRMSG, "errmsg", VAR_STRING, VV_COMPAT), diff --git a/test/functional/eval/special_vars_spec.lua b/test/functional/eval/special_vars_spec.lua index 3d9358447e..b5773a5529 100644 --- a/test/functional/eval/special_vars_spec.lua +++ b/test/functional/eval/special_vars_spec.lua @@ -168,4 +168,11 @@ describe('Special values', function() 'Expected True but got v:null', }, meths.get_vvar('errors')) end) + + describe('compat', function() + it('v:count is distinct from count', function() + command('let count = []') -- v:count is readonly + eq(1, eval('count is# g:["count"]')) + end) + end) end) |