Mercurial > vim
diff runtime/doc/eval.txt @ 15008:67e3103d6e18 v8.1.0515
patch 8.1.0515: reloading a script gives errors for existing functions
commit https://github.com/vim/vim/commit/ded5f1bed7ff2d138b3ee0f9610d17290b62692d
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Nov 10 17:33:29 2018 +0100
patch 8.1.0515: reloading a script gives errors for existing functions
Problem: Reloading a script gives errors for existing functions.
Solution: Allow redefining a function once when reloading a script.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 10 Nov 2018 17:45:06 +0100 |
parents | 2b30a2b4bde2 |
children | c338c91086b9 |
line wrap: on
line diff
--- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -9673,9 +9673,13 @@ See |:verbose-cmd| for more information. deleted if there are no more references to it. *E127* *E122* When a function by this name already exists and [!] is - not used an error message is given. When [!] is used, - an existing function is silently replaced. Unless it - is currently being executed, that is an error. + not used an error message is given. There is one + exception: When sourcing a script again, a function + that was previously defined in that script will be + silently replaced. + When [!] is used, an existing function is silently + replaced. Unless it is currently being executed, that + is an error. NOTE: Use ! wisely. If used without care it can cause an existing function to be replaced unexpectedly, which is hard to debug.