mirror of
https://github.com/neovim/neovim.git
synced 2026-06-16 00:31:16 +00:00
fix(messages): avoid recursive rtp build due to msg_show #39888
Problem: If there are pending messages when starting to build the
runtime search path, a msg_show callback may invoke
runtime_search_path_validate() recursively.
Solution: Avoid msg_show callback by ensuring messages are flushed.
(cherry picked from commit 53da0c5060)
This commit is contained in:
committed by
github-actions[bot]
parent
8fccb26cd3
commit
33b6b0bfe5
@@ -933,6 +933,7 @@ void runtime_search_path_validate(void)
|
||||
}
|
||||
if (!runtime_search_path_valid) {
|
||||
if (!runtime_search_path_ref) {
|
||||
msg_ext_ui_flush(); // avoid recursion due to UI callback
|
||||
runtime_search_path_free(runtime_search_path);
|
||||
}
|
||||
runtime_search_path = runtime_search_path_build();
|
||||
|
||||
@@ -1794,6 +1794,18 @@ describe('runtime:', function()
|
||||
command('edit FTDETECT')
|
||||
eq('SsABab', eval('g:aseq'))
|
||||
end)
|
||||
|
||||
it('no crash for recursive search_path build #39815', function()
|
||||
clear()
|
||||
local screen = Screen.new()
|
||||
fn.jobstart({
|
||||
nvim_prog,
|
||||
'--clean',
|
||||
'+lua require("vim._core.ui2").enable()',
|
||||
'+set rtp+=$FOO | set syntax',
|
||||
}, { term = true, env = { VIMRUNTIME = os.getenv('VIMRUNTIME') } })
|
||||
screen:expect({ any = 'syntax', none = 'Process exited 1' })
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('user session', function()
|
||||
|
||||
Reference in New Issue
Block a user