feat: fire User autocmds for plugin state changes#227
Open
3dyuval wants to merge 1 commit intocoder:mainfrom
Open
feat: fire User autocmds for plugin state changes#2273dyuval wants to merge 1 commit intocoder:mainfrom
3dyuval wants to merge 1 commit intocoder:mainfrom
Conversation
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.
Summary
Fires
doautocmd User <event>at key plugin state transitions so configs and other plugins can react without poking at internals.ClaudeCodeDiffOpened_open_native_diff)ClaudeCodeDiffClosed_resolve_diff_as_saved) or rejected (_resolve_diff_as_rejected)ClaudeCodeConnectedon_connect)ClaudeCodeDisconnectedon_disconnect)ClaudeCodeTerminalOpenedClaudeCodeTerminalHiddenUsage
Auto-hide the terminal float when a diff opens, so the diff buffers aren't covered:
Changes
lua/claudecode/diff.lua:ClaudeCodeDiffOpenedbefore returning from_open_native_diff;ClaudeCodeDiffClosedin both_resolve_diff_as_savedand_resolve_diff_as_rejectedlua/claudecode/server/init.lua:ClaudeCodeConnected/ClaudeCodeDisconnectedin the WebSocket callbacks, wrapped invim.schedulesince callbacks run off the main threadlua/claudecode/terminal/snacks.lua:ClaudeCodeTerminalOpened/ClaudeCodeTerminalHiddeninopen,simple_toggle, andfocus_togglelua/claudecode/terminal/native.lua: same events inopen_terminal,hide_terminal, andshow_hidden_terminalCloses #222