0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.2195: failing tests for :const

Problem:    Failing tests for :const.
Solution:   Add missing check for ASSIGN_FINAL.
This commit is contained in:
Bram Moolenaar
2020-12-22 22:07:30 +01:00
parent 89b474dd4f
commit 1dcf55d4f1
4 changed files with 8 additions and 8 deletions

View File

@@ -752,9 +752,6 @@ ex_let(exarg_T *eap)
emsg(_(e_cannot_use_let_in_vim9_script));
return;
}
if (eap->cmdidx == CMD_const && !vim9script && !eap->forceit)
// In legacy Vim script ":const" works like ":final".
eap->cmdidx = CMD_final;
if (eap->cmdidx == CMD_const)
flags |= ASSIGN_CONST;
@@ -3231,7 +3228,8 @@ set_var_const(
init_tv(tv);
}
// ":const var = val" locks the value
// ":const var = value" locks the value
// ":final var = value" locks "var"
if (flags & ASSIGN_CONST)
// Like :lockvar! name: lock the value and what it contains, but only
// if the reference count is up to one. That locks only literal