mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06: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:
@@ -1365,7 +1365,7 @@ nvim_set_current_buf({buffer}) *nvim_set_current_buf()*
|
||||
Sets the current buffer.
|
||||
|
||||
Attributes: ~
|
||||
not allowed when |textlock| is active
|
||||
not allowed when |textlock| is active or in the |cmdwin|
|
||||
|
||||
Parameters: ~
|
||||
• {buffer} Buffer handle
|
||||
@@ -1389,7 +1389,7 @@ nvim_set_current_tabpage({tabpage}) *nvim_set_current_tabpage()*
|
||||
Sets the current tabpage.
|
||||
|
||||
Attributes: ~
|
||||
not allowed when |textlock| is active
|
||||
not allowed when |textlock| is active or in the |cmdwin|
|
||||
|
||||
Parameters: ~
|
||||
• {tabpage} Tabpage handle
|
||||
@@ -1398,7 +1398,7 @@ nvim_set_current_win({window}) *nvim_set_current_win()*
|
||||
Sets the current window.
|
||||
|
||||
Attributes: ~
|
||||
not allowed when |textlock| is active
|
||||
not allowed when |textlock| is active or in the |cmdwin|
|
||||
|
||||
Parameters: ~
|
||||
• {window} Window handle
|
||||
@@ -2163,7 +2163,7 @@ nvim_buf_delete({buffer}, {opts}) *nvim_buf_delete()*
|
||||
Deletes the buffer. See |:bwipeout|
|
||||
|
||||
Attributes: ~
|
||||
not allowed when |textlock| is active
|
||||
not allowed when |textlock| is active or in the |cmdwin|
|
||||
|
||||
Parameters: ~
|
||||
• {buffer} Buffer handle, or 0 for current buffer
|
||||
@@ -2894,7 +2894,7 @@ nvim_win_hide({window}) *nvim_win_hide()*
|
||||
or |nvim_win_close()|, which will close the buffer.
|
||||
|
||||
Attributes: ~
|
||||
not allowed when |textlock| is active
|
||||
not allowed when |textlock| is active or in the |cmdwin|
|
||||
|
||||
Parameters: ~
|
||||
• {window} Window handle, or 0 for current window
|
||||
@@ -2912,7 +2912,7 @@ nvim_win_set_buf({window}, {buffer}) *nvim_win_set_buf()*
|
||||
Sets the current buffer in a window, without side effects
|
||||
|
||||
Attributes: ~
|
||||
not allowed when |textlock| is active
|
||||
not allowed when |textlock| is active or in the |cmdwin|
|
||||
|
||||
Parameters: ~
|
||||
• {window} Window handle, or 0 for current window
|
||||
@@ -2999,7 +2999,7 @@ nvim_open_win({buffer}, {enter}, {*config}) *nvim_open_win()*
|
||||
<
|
||||
|
||||
Attributes: ~
|
||||
not allowed when |textlock| is active
|
||||
not allowed when |textlock| is active or in the |cmdwin|
|
||||
|
||||
Parameters: ~
|
||||
• {buffer} Buffer to display, or 0 for current buffer
|
||||
|
||||
Reference in New Issue
Block a user