diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2023-04-20 21:17:25 +0100 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2023-07-05 08:31:52 +0100 |
commit | 77118d0da8badc4135be430f4cbb15bc95bc760f (patch) | |
tree | e1168e881f49751b807524559720e5212661244e /scripts/gen_vimdoc.py | |
parent | b2e8c0df2062f765a4cf7d96379c5f0f19393dfd (diff) | |
download | rneovim-77118d0da8badc4135be430f4cbb15bc95bc760f.tar.gz rneovim-77118d0da8badc4135be430f4cbb15bc95bc760f.tar.bz2 rneovim-77118d0da8badc4135be430f4cbb15bc95bc760f.zip |
fix(api): use text_locked() to check textlock
Problem: some API functions that check textlock (usually those that can change
curwin or curbuf) can break the cmdwin.
Solution: make FUNC_API_CHECK_TEXTLOCK call text_locked() instead, which already
checks for textlock, cmdwin and `<expr>` status.
Add FUNC_API_TEXTLOCK_ALLOW_CMDWIN to allow such functions to be usable in the
cmdwin if they can work properly there; the opt-in nature of this attribute
should hopefully help mitigate future bugs.
Also fix a regression in #22634 that made functions checking textlock usable in
`<expr>` mappings, and rename FUNC_API_CHECK_TEXTLOCK to FUNC_API_TEXTLOCK.
Diffstat (limited to 'scripts/gen_vimdoc.py')
-rwxr-xr-x | scripts/gen_vimdoc.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/gen_vimdoc.py b/scripts/gen_vimdoc.py index 96db0d1aad..8410a3b5b1 100755 --- a/scripts/gen_vimdoc.py +++ b/scripts/gen_vimdoc.py @@ -310,7 +310,8 @@ param_exclude = ( # Annotations are displayed as line items after API function descriptions. annotation_map = { 'FUNC_API_FAST': '|api-fast|', - 'FUNC_API_CHECK_TEXTLOCK': 'not allowed when |textlock| is active', + 'FUNC_API_TEXTLOCK': 'not allowed when |textlock| is active or in the |cmdwin|', + 'FUNC_API_TEXTLOCK_ALLOW_CMDWIN': 'not allowed when |textlock| is active', 'FUNC_API_REMOTE_ONLY': '|RPC| only', 'FUNC_API_LUA_ONLY': 'Lua |vim.api| only', } |