Restrict AI context menu to Ctrl + selection + right-click - #4
Conversation
… + right-click Signed-off-by: Cinnavun <llshadowz@gmail.com>
…for base url and optional api key Signed-off-by: Cinnavun <llshadowz@gmail.com>
Signed-off-by: Cinnavun <llshadowz@gmail.com>
…Context into NppAIAssistant+FixContext/main
|
Thank you for this contribution, and apologies for the delayed response. I'm still learning software development and GitHub's collaboration norms, so I've been taking time to understand the code paths and validate the changes carefully. I appreciate your patience. The Ctrl + selection + right-click behavior directly addresses issue #2 and is a strong usability direction, since it preserves the normal Notepad++ context menu. Since this PR was opened, the repository has also gained:
This PR touches those same overlapping provider, timeout, and settings paths, so I can't merge it as-is — I need to reconcile it against the newer boundaries first. I'm treating the context-menu behavior as a focused integration candidate and will keep the issue open until it's verified in an updated build. The current update also improves prompt governance, default-locked built-in prompt sections, and Traditional Chinese panel layout. Feel free to test the PR's interaction flow and share what you observe, especially: Normal right-click, with and without a selection Project: https://github.com/pingqLIN/NppAIAssistant |
addresses #2
Problem: On text selection, the plugin's popup menu replaces Notepad++'s default right-click context menu entirely, rather than appending to it.
Change: The AI plugin context menu now only appears when ctrlPressed + hasSelection — i.e., Ctrl + right-click with an active selection. Right-click otherwise retains the standard Notepad++ menu.
Alternative: Since the AI context commands mirror the Plugin Menu commands, users can add the following lines to contextMenu.xml (%APPDATA%\Notepad++\contextMenu.xml) to append safely and access them without holding ctrl.
Built x64 | Release and tested on Windows - confirmed all the above working