Mercurial > vim
diff runtime/doc/vim9.txt @ 28447:6f753a8125f0 v8.2.4748
patch 8.2.4748: cannot use an imported function in a mapping
Commit: https://github.com/vim/vim/commit/8944551534b311a2d25acf6e8db235c6d906256c
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Apr 14 12:58:23 2022 +0100
patch 8.2.4748: cannot use an imported function in a mapping
Problem: Cannot use an imported function in a mapping.
Solution: Recognize <SID>name.Func.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 14 Apr 2022 14:00:05 +0200 |
parents | 473cfd79bcd8 |
children | f73a9bdff3a3 |
line wrap: on
line diff
--- a/runtime/doc/vim9.txt +++ b/runtime/doc/vim9.txt @@ -1720,7 +1720,15 @@ line, there can be no line break: > name # Error! echo that .name # Error! -< *:import-cycle* + +To refer to a function in an imported script in a mapping, |<SID>| can be +used: > + noremap <silent> ,a :call <SID>name.Function()<CR> + +When the mapping is defined "<SID>name." will be replaced with <SNR> and the +script ID of the imported script. + + *:import-cycle* The `import` commands are executed when encountered. If script A imports script B, and B (directly or indirectly) imports A, this will be skipped over. At this point items in A after "import B" will not have been processed and