Conversation
Copilot
AI
changed the title
[WIP] Refactor autocmd registration for ddc.vim
Centralize cmdline autocmd management: delegate register/unregister to denops API
Feb 24, 2026
- Add registerCmdlineAutocmds()/unregisterCmdlineAutocmds() to Ddc class - Remove CmdlineChanged from initialize() (moved to registerCmdlineAutocmds) - Add registerCmdlineAutocmds/unregisterCmdlineAutocmds to denops dispatcher - Add ddc#_on_cmdline_leave() public wrapper for script-local function - Update ddc#enable_cmdline_completion() to delegate to denops with fallback - Update s:disable_cmdline_completion() to delegate to denops with fallback Co-authored-by: Shougo <41495+Shougo@users.noreply.github.com>
0813146 to
6363611
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ddc.ts'sinitialize()directly registered aCmdlineChangedautocmd alongside the autoload-managedddc-cmdlineaugroup, splitting cmdline autocmd ownership across two layers. This PR moves all cmdline autocmd registration/deregistration into the denops side while preserving the autoload-controlled enable/disable lifecycle.denops side (
ddc.ts/app.ts)CmdlineChanged(for=/@cmdline types) frominitialize()— previously the only cmdline autocmd hardcoded in denops startupregisterCmdlineAutocmds()toDdcclass: registers the fullddc-cmdlineaugroup (CmdlineLeave,CmdlineEnter,CmdlineChangedfor all types,ModeChanged c:n). Clears group first (helper.remove()) for idempotencyunregisterCmdlineAutocmds(): clears theddc-cmdlinegroupapp.tsautoload side (
autoload/ddc.vim)ddc#_on_cmdline_leave(): public wrapper arounds:disable_cmdline_completion(), required because denops-registered autocmds cannot invoke script-local functionsddc#enable_cmdline_completion(): delegates toddc#denops#_notify('registerCmdlineAutocmds', [])when denops is running; falls back to direct augroup creation otherwise (covers all cmdline types, matching the consolidated denops behavior)s:disable_cmdline_completion(): delegates toddc#denops#_notify('unregisterCmdlineAutocmds', [])when denops is running; falls back toautocmd! ddc-cmdlineotherwiseWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
jsr.io/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.