Skip to content

Restrict AI context menu to Ctrl + selection + right-click - #4

Open
Cinnavun wants to merge 3 commits into
pingqLIN:mainfrom
Cinnavun:main
Open

Restrict AI context menu to Ctrl + selection + right-click#4
Cinnavun wants to merge 3 commits into
pingqLIN:mainfrom
Cinnavun:main

Conversation

@Cinnavun

Copy link
Copy Markdown

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.

		<Item FolderName="Plugin commands" TranslateID="contextMenu-PluginCommands" PluginEntryName="NppAIAssistant" PluginCommandItemName="Explain Selection" />
		<Item FolderName="Plugin commands" TranslateID="contextMenu-PluginCommands" PluginEntryName="NppAIAssistant" PluginCommandItemName="Fix Selection" />
		<Item FolderName="Plugin commands" TranslateID="contextMenu-PluginCommands" PluginEntryName="NppAIAssistant" PluginCommandItemName="Refactor Selection" />
		<Item FolderName="Plugin commands" TranslateID="contextMenu-PluginCommands" PluginEntryName="NppAIAssistant" PluginCommandItemName="Add Comments to Selection" />

Built x64 | Release and tested on Windows - confirmed all the above working

… + right-click

Signed-off-by: Cinnavun <llshadowz@gmail.com>
…for base url and optional api key

Signed-off-by: Cinnavun <llshadowz@gmail.com>
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.

1 participant