mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
main: do event_init before early_init #10183
Fixes https://github.com/neovim/neovim/issues/10172 * move log_init to event_init * move init_signs to end of early_init
This commit is contained in:

committed by
Justin M. Keyes

parent
babcf641ef
commit
6f27f5ef91
@@ -141,6 +141,7 @@ static const char *err_extra_cmd =
|
|||||||
|
|
||||||
void event_init(void)
|
void event_init(void)
|
||||||
{
|
{
|
||||||
|
log_init();
|
||||||
loop_init(&main_loop, NULL);
|
loop_init(&main_loop, NULL);
|
||||||
// early msgpack-rpc initialization
|
// early msgpack-rpc initialization
|
||||||
msgpack_rpc_init_method_table();
|
msgpack_rpc_init_method_table();
|
||||||
@@ -185,7 +186,6 @@ bool event_teardown(void)
|
|||||||
/// Needed for unit tests. Must be called after `time_init()`.
|
/// Needed for unit tests. Must be called after `time_init()`.
|
||||||
void early_init(void)
|
void early_init(void)
|
||||||
{
|
{
|
||||||
log_init();
|
|
||||||
env_init();
|
env_init();
|
||||||
fs_init();
|
fs_init();
|
||||||
handle_init();
|
handle_init();
|
||||||
@@ -222,6 +222,8 @@ void early_init(void)
|
|||||||
TIME_MSG("inits 1");
|
TIME_MSG("inits 1");
|
||||||
|
|
||||||
set_lang_var(); // set v:lang and v:ctype
|
set_lang_var(); // set v:lang and v:ctype
|
||||||
|
|
||||||
|
init_signs();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAKE_LIB
|
#ifdef MAKE_LIB
|
||||||
@@ -257,12 +259,13 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
init_startuptime(¶ms);
|
init_startuptime(¶ms);
|
||||||
|
|
||||||
|
event_init();
|
||||||
|
|
||||||
early_init();
|
early_init();
|
||||||
|
|
||||||
// Check if we have an interactive window.
|
// Check if we have an interactive window.
|
||||||
check_and_set_isatty(¶ms);
|
check_and_set_isatty(¶ms);
|
||||||
|
|
||||||
event_init();
|
|
||||||
// Process the command line arguments. File names are put in the global
|
// Process the command line arguments. File names are put in the global
|
||||||
// argument list "global_alist".
|
// argument list "global_alist".
|
||||||
command_line_scan(¶ms);
|
command_line_scan(¶ms);
|
||||||
@@ -1312,8 +1315,6 @@ static void init_path(const char *exename)
|
|||||||
// shipped with Windows package. This also mimics SearchPath().
|
// shipped with Windows package. This also mimics SearchPath().
|
||||||
os_setenv_append_path(exepath);
|
os_setenv_append_path(exepath);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
init_signs();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get filename from command line, if any.
|
/// Get filename from command line, if any.
|
||||||
|
@@ -221,6 +221,11 @@ describe('startup', function()
|
|||||||
clear{args={'--embed'}}
|
clear{args={'--embed'}}
|
||||||
eq(2, eval('1+1'))
|
eq(2, eval('1+1'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('does not crash when expanding cdpath during early_init', function()
|
||||||
|
clear{env={CDPATH='~doesnotexist'}}
|
||||||
|
eq(',~doesnotexist', eval('&cdpath'))
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe('sysinit', function()
|
describe('sysinit', function()
|
||||||
|
Reference in New Issue
Block a user