mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 09:26:30 +00:00
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.
This commit is contained in:
@@ -226,8 +226,10 @@
|
||||
# define FUNC_API_REMOTE_ONLY
|
||||
/// API function not exposed in Vimscript/remote.
|
||||
# define FUNC_API_LUA_ONLY
|
||||
/// API function checked textlock.
|
||||
# define FUNC_API_CHECK_TEXTLOCK
|
||||
/// API function fails during textlock.
|
||||
# define FUNC_API_TEXTLOCK
|
||||
/// API function fails during textlock, but allows cmdwin.
|
||||
# define FUNC_API_TEXTLOCK_ALLOW_CMDWIN
|
||||
/// API function introduced at the given API level.
|
||||
# define FUNC_API_SINCE(X)
|
||||
/// API function deprecated since the given API level.
|
||||
|
Reference in New Issue
Block a user