Fix incorrect code

ref: 8ae049afbc (r135905629)

And also add new entries to tabContextMenu_example.xml
This commit is contained in:
Don Ho 2023-12-30 03:53:47 +01:00
parent d039eaa900
commit 4bde0d4b53
2 changed files with 50 additions and 47 deletions

View File

@ -561,7 +561,7 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa
Sci_TextRangeFull tr; Sci_TextRangeFull tr;
tr.chrg.cpMin = posStart; tr.chrg.cpMin = posStart;
tr.chrg.cpMax = posEnd + 2; tr.chrg.cpMax = posEnd + 2;
if (tr.chrg.cpMax > static_cast<Sci_PositionCR>(docLen)) if (tr.chrg.cpMax > static_cast<Sci_Position>(docLen))
{ {
tr.chrg.cpMax = docLen; tr.chrg.cpMax = docLen;
} }

View File

@ -7,59 +7,62 @@ Please check "How to Customize the Context Menu" on:
https://npp-user-manual.org/docs/config-files/#the-context-menu-tabcontextmenu-xml https://npp-user-manual.org/docs/config-files/#the-context-menu-tabcontextmenu-xml
--> -->
<NotepadPlus> <NotepadPlus>
<TabContextMenu> <TabContextMenu>
<!-- <!--
Use MenuEntryName and MenuItemName to localize your commands to add. Use MenuEntryName and MenuItemName to localize your commands to add.
The values should be in English but not in translated language. The values should be in English but not in translated language.
(You can set Notepad++ language back to English from Preferences dialog via menu "Settings->Preferences...") (You can set Notepad++ language back to English from Preferences dialog via menu "Settings->Preferences...")
--> -->
<Item MenuEntryName="File" MenuItemName="Close"/> <Item MenuEntryName="File" MenuItemName="Close"/>
<!-- <!--
Use FolderName (optional) to create sub-menu. FolderName value can be in any language (French, Japanese...). Use FolderName (optional) to create sub-menu. FolderName value can be in any language (French, Japanese...).
--> -->
<Item FolderName="Close Multiple Tabs" MenuEntryName="File" MenuItemName="Close All but Active Document"/> <Item FolderName="Close Multiple Tabs" MenuEntryName="File" MenuItemName="Close All but Active Document"/>
<Item FolderName="Close Multiple Tabs" MenuEntryName="File" MenuItemName="Close All to the Left"/> <Item FolderName="Close Multiple Tabs" MenuEntryName="File" MenuItemName="Close All to the Left"/>
<Item FolderName="Close Multiple Tabs" MenuEntryName="File" MenuItemName="Close All to the Right"/> <Item FolderName="Close Multiple Tabs" MenuEntryName="File" MenuItemName="Close All to the Right"/>
<Item FolderName="Close Multiple Tabs" MenuEntryName="File" MenuItemName="Close All Unchanged"/> <Item FolderName="Close Multiple Tabs" MenuEntryName="File" MenuItemName="Close All Unchanged"/>
<Item MenuEntryName="File" MenuItemName="Save"/> <Item MenuEntryName="File" MenuItemName="Save"/>
<Item MenuEntryName="File" MenuItemName="Save As..."/> <Item MenuEntryName="File" MenuItemName="Save As..."/>
<Item FolderName="Open into" MenuEntryName="File" MenuItemName="Explorer"/>
<Item FolderName="Open into" MenuEntryName="File" MenuItemName="cmd"/>
<Item FolderName="Open into" MenuEntryName="File" MenuItemName="Folder as Workspace"/>
<Item FolderName="Open into" id="0"/>
<Item FolderName="Open into" MenuEntryName="File" MenuItemName="Open in Default Viewer"/>
<Item MenuEntryName="File" MenuItemName="Rename..."/> <Item FolderName="Open into" MenuEntryName="File" MenuItemName="Explorer"/>
<Item MenuEntryName="File" MenuItemName="Move to Recycle Bin"/> <Item FolderName="Open into" MenuEntryName="File" MenuItemName="cmd"/>
<Item MenuEntryName="File" MenuItemName="Reload from Disk"/> <Item FolderName="Open into" MenuEntryName="File" MenuItemName="Folder as Workspace"/>
<Item MenuEntryName="File" MenuItemName="Print..."/> <Item FolderName="Open into" id="0"/>
<Item FolderName="Open into" MenuEntryName="File" MenuItemName="Open in Default Viewer"/>
<!-- id="0" is the separator --> <Item MenuEntryName="File" MenuItemName="Rename..."/>
<Item id="0"/> <Item MenuEntryName="File" MenuItemName="Move to Recycle Bin"/>
<Item MenuEntryName="File" MenuItemName="Reload from Disk"/>
<Item MenuEntryName="File" MenuItemName="Print..."/>
<Item MenuEntryName="Edit" MenuItemName="Set Read-Only"/> <!-- id="0" is the separator -->
<Item MenuEntryName="Edit" MenuItemName="Clear Read-Only Flag"/> <Item id="0"/>
<Item id="0"/> <Item MenuEntryName="Edit" MenuItemName="Set Read-Only"/>
<Item MenuEntryName="Edit" MenuItemName="Clear Read-Only Flag"/>
<Item FolderName="Copy to Clipboard" MenuEntryName="Edit" MenuItemName="Copy Current Full File Path"/>
<Item FolderName="Copy to Clipboard" MenuEntryName="Edit" MenuItemName="Copy Current Filename"/>
<Item FolderName="Copy to Clipboard" MenuEntryName="Edit" MenuItemName="Copy Current Dir. Path"/>
<Item FolderName="Move Document" MenuEntryName="View" MenuItemName="Move to Other View"/>
<Item FolderName="Move Document" MenuEntryName="View" MenuItemName="Clone to Other View"/>
<Item FolderName="Move Document" MenuEntryName="View" MenuItemName="Move to New Instance"/>
<Item FolderName="Move Document" MenuEntryName="View" MenuItemName="Open in New Instance"/>
<Item FolderName="Apply Color to Tab" MenuEntryName="View" MenuItemName="Apply Color 1"/>
<Item FolderName="Apply Color to Tab" MenuEntryName="View" MenuItemName="Apply Color 2"/>
<Item FolderName="Apply Color to Tab" MenuEntryName="View" MenuItemName="Apply Color 3"/>
<Item FolderName="Apply Color to Tab" MenuEntryName="View" MenuItemName="Apply Color 4"/>
<Item FolderName="Apply Color to Tab" MenuEntryName="View" MenuItemName="Apply Color 5"/>
<Item FolderName="Apply Color to Tab" MenuEntryName="View" MenuItemName="Remove Color"/>
</TabContextMenu> <Item id="0"/>
<Item FolderName="Copy to Clipboard" MenuEntryName="Edit" MenuItemName="Copy Current Full File Path"/>
<Item FolderName="Copy to Clipboard" MenuEntryName="Edit" MenuItemName="Copy Current Filename"/>
<Item FolderName="Copy to Clipboard" MenuEntryName="Edit" MenuItemName="Copy Current Dir. Path"/>
<Item FolderName="Move Document" MenuEntryName="View" MenuItemName="Move to Start"/>
<Item FolderName="Move Document" MenuEntryName="View" MenuItemName="Move to End"/>
<Item FolderName="Move Document" id="0"/>
<Item FolderName="Move Document" MenuEntryName="View" MenuItemName="Move to Other View"/>
<Item FolderName="Move Document" MenuEntryName="View" MenuItemName="Clone to Other View"/>
<Item FolderName="Move Document" MenuEntryName="View" MenuItemName="Move to New Instance"/>
<Item FolderName="Move Document" MenuEntryName="View" MenuItemName="Open in New Instance"/>
<Item FolderName="Apply Color to Tab" MenuEntryName="View" MenuItemName="Apply Color 1"/>
<Item FolderName="Apply Color to Tab" MenuEntryName="View" MenuItemName="Apply Color 2"/>
<Item FolderName="Apply Color to Tab" MenuEntryName="View" MenuItemName="Apply Color 3"/>
<Item FolderName="Apply Color to Tab" MenuEntryName="View" MenuItemName="Apply Color 4"/>
<Item FolderName="Apply Color to Tab" MenuEntryName="View" MenuItemName="Apply Color 5"/>
<Item FolderName="Apply Color to Tab" MenuEntryName="View" MenuItemName="Remove Color"/>
</TabContextMenu>
</NotepadPlus> </NotepadPlus>
<!-- <!--