comparison runtime/doc/eval.txt @ 17109:cc5d4b4bae83 v8.1.1554

patch 8.1.1554: docs and tests for :const can be improved commit https://github.com/vim/vim/commit/1c196e7b1742c1a50ce0d74190721acaad087f81 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 16 15:41:58 2019 +0200 patch 8.1.1554: docs and tests for :const can be improved Problem: Docs and tests for :const can be improved. Solution: Improve documentation, add a few more tests. (Ryuichi Hayashida, closes #4551)
author Bram Moolenaar <Bram@vim.org>
date Sun, 16 Jun 2019 15:45:06 +0200
parents 620e9011b685
children be5a5cfc991a
comparison
equal deleted inserted replaced
17108:1bf755ebbd7a 17109:cc5d4b4bae83
11617 No error message is given for a non-existing 11617 No error message is given for a non-existing
11618 variable, also without !. 11618 variable, also without !.
11619 If the system does not support deleting an environment 11619 If the system does not support deleting an environment
11620 variable, it is made empty. 11620 variable, it is made empty.
11621 11621
11622 *:cons* *:const* *E996* 11622 *:cons* *:const*
11623 :cons[t] {var-name} = {expr1} 11623 :cons[t] {var-name} = {expr1}
11624 :cons[t] [{name1}, {name2}, ...] = {expr1} 11624 :cons[t] [{name1}, {name2}, ...] = {expr1}
11625 :cons[t] [{name1}, {name2}, ...] .= {expr1}
11626 :cons[t] [{name}, ..., ; {lastname}] = {expr1} 11625 :cons[t] [{name}, ..., ; {lastname}] = {expr1}
11627 :cons[t] {var-name} =<< [trim] {marker} 11626 :cons[t] {var-name} =<< [trim] {marker}
11628 text... 11627 text...
11629 text... 11628 text...
11630 {marker} 11629 {marker}
11639 is not modified. 11638 is not modified.
11640 *E995* 11639 *E995*
11641 |:const| does not allow to for changing a variable. > 11640 |:const| does not allow to for changing a variable. >
11642 :let x = 1 11641 :let x = 1
11643 :const x = 2 " Error! 11642 :const x = 2 " Error!
11644 < 11643 < *E996*
11644 Note that environment variables, option values and
11645 register values cannot be used here, since they cannot
11646 be locked.
11647
11645 :lockv[ar][!] [depth] {name} ... *:lockvar* *:lockv* 11648 :lockv[ar][!] [depth] {name} ... *:lockvar* *:lockv*
11646 Lock the internal variable {name}. Locking means that 11649 Lock the internal variable {name}. Locking means that
11647 it can no longer be changed (until it is unlocked). 11650 it can no longer be changed (until it is unlocked).
11648 A locked variable can be deleted: > 11651 A locked variable can be deleted: >
11649 :lockvar v 11652 :lockvar v