Skip to content

fix: only call denops#plugin#wait after denops#plugin#load#44

Merged
Shougo merged 1 commit into
mainfrom
copilot/check-dpp-lazy-loading-issue
Jun 16, 2026
Merged

fix: only call denops#plugin#wait after denops#plugin#load#44
Shougo merged 1 commit into
mainfrom
copilot/check-dpp-lazy-loading-issue

Conversation

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

When a lazy plugin with a denops component is triggered (e.g. via on_event = 'InsertEnter') before denops finishes its async startup, denops#plugin#wait was executing unconditionally whenever the server wasn't 'stopped' — even though denops#plugin#load had been skipped (requires 'running'). Since plugin.sourced is set to true before the denops section, the plugin gets permanently marked as sourced with its denops component never actually loaded.

Change

Move denops#plugin#wait inside the denops#server#status() ==# 'running' block so it only fires when denops#plugin#load was actually called:

" Before
if denops#server#status() ==# 'running'
  call denops#plugin#load(name, ...)
endif
if denops#server#status() !=# 'stopped'   " true when 'starting' too
      \ && plugin->get('denops_wait', v:true)
  call denops#plugin#wait(name)            " called on never-loaded plugin
  redraw
endif

" After
if denops#server#status() ==# 'running'
  call denops#plugin#load(name, ...)
  if plugin->get('denops_wait', v:true)
    call denops#plugin#wait(name)
    redraw
  endif
endif

@Shougo Shougo marked this pull request as ready for review June 16, 2026 01:46
@Shougo Shougo merged commit ac75836 into main Jun 16, 2026
3 checks passed
@Shougo Shougo deleted the copilot/check-dpp-lazy-loading-issue branch June 16, 2026 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants