aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/autocmd.c3
-rw-r--r--src/nvim/main.c2
-rw-r--r--src/nvim/ui.c10
3 files changed, 14 insertions, 1 deletions
diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c
index 2537269c5c..bdb3983ab3 100644
--- a/src/nvim/autocmd.c
+++ b/src/nvim/autocmd.c
@@ -2570,6 +2570,9 @@ void do_autocmd_uienter(uint64_t chanid, bool attached)
{
static bool recursive = false;
+ if (starting == NO_SCREEN) {
+ return; // user config hasn't been sourced yet
+ }
if (recursive) {
return; // disallow recursion
}
diff --git a/src/nvim/main.c b/src/nvim/main.c
index c57f0e187a..88d198bfa5 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -589,7 +589,7 @@ int main(int argc, char **argv)
apply_autocmds(EVENT_VIMENTER, NULL, NULL, false, curbuf);
TIME_MSG("VimEnter autocommands");
if (use_remote_ui) {
- do_autocmd_uienter(CHAN_STDIO, true);
+ do_autocmd_uienter_all();
TIME_MSG("UIEnter autocommands");
}
diff --git a/src/nvim/ui.c b/src/nvim/ui.c
index 954d933d9c..90d475e7e7 100644
--- a/src/nvim/ui.c
+++ b/src/nvim/ui.c
@@ -337,6 +337,16 @@ void vim_beep(unsigned val)
}
}
+/// Trigger UIEnter for all attached UIs.
+/// Used on startup after VimEnter.
+void do_autocmd_uienter_all(void)
+{
+ for (size_t i = 0; i < ui_count; i++) {
+ UIData *data = uis[i]->data;
+ do_autocmd_uienter(data->channel_id, true);
+ }
+}
+
void ui_attach_impl(UI *ui, uint64_t chanid)
{
if (ui_count == MAX_UI_COUNT) {