Mercurial > vim
comparison src/evalvars.c @ 21843:4a4678d26822 v8.2.1471
patch 8.2.1471: :const only locks the variable, not the value
Commit: https://github.com/vim/vim/commit/241572794f7e93d2f8b762de2300e5f7e4f07628
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 16 22:50:01 2020 +0200
patch 8.2.1471: :const only locks the variable, not the value
Problem: :const only locks the variable, not the value.
Solution: Lock the value as ":lockvar 1 var" would do. (closes https://github.com/vim/vim/issues/6719)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 16 Aug 2020 23:00:04 +0200 |
parents | c7699985db00 |
children | fb74a3387694 |
comparison
equal
deleted
inserted
replaced
21842:f40d7d8ca768 | 21843:4a4678d26822 |
---|---|
3085 di->di_tv.v_lock = 0; | 3085 di->di_tv.v_lock = 0; |
3086 init_tv(tv); | 3086 init_tv(tv); |
3087 } | 3087 } |
3088 | 3088 |
3089 if (flags & LET_IS_CONST) | 3089 if (flags & LET_IS_CONST) |
3090 di->di_tv.v_lock |= VAR_LOCKED; | 3090 item_lock(&di->di_tv, 1, TRUE); |
3091 } | 3091 } |
3092 | 3092 |
3093 /* | 3093 /* |
3094 * Return TRUE if di_flags "flags" indicates variable "name" is read-only. | 3094 * Return TRUE if di_flags "flags" indicates variable "name" is read-only. |
3095 * Also give an error message. | 3095 * Also give an error message. |