mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
compat: "v:count" distinct from "count" (#7407)
This commit is contained in:
parent
55d8967147
commit
9837a9c401
@ -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
|
||||
|
@ -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*
|
||||
|
||||
|
@ -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),
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user