Skip to content

Commit

Permalink
Fix incorrect code
Browse files Browse the repository at this point in the history
ref: notepad-plus-plus@8ae049a#r135905629

And also add new entries to tabContextMenu_example.xml
  • Loading branch information
donho committed Dec 30, 2023
1 parent d039eaa commit 4bde0d4
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 47 deletions.
2 changes: 1 addition & 1 deletion PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa
Sci_TextRangeFull tr;
tr.chrg.cpMin = posStart;
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;
}
Expand Down
95 changes: 49 additions & 46 deletions PowerEditor/src/tabContextMenu_example.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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
-->
<NotepadPlus>
<TabContextMenu>
<!--
Use MenuEntryName and MenuItemName to localize your commands to add.
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...")
-->
<Item MenuEntryName="File" MenuItemName="Close"/>
<TabContextMenu>
<!--
Use MenuEntryName and MenuItemName to localize your commands to add.
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...")
-->
<Item MenuEntryName="File" MenuItemName="Close"/>

<!--
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 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 Unchanged"/>
<!--
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 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 Unchanged"/>

<Item MenuEntryName="File" MenuItemName="Save"/>
<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="Save"/>
<Item MenuEntryName="File" MenuItemName="Save As..."/>

<Item MenuEntryName="File" MenuItemName="Rename..."/>
<Item MenuEntryName="File" MenuItemName="Move to Recycle Bin"/>
<Item MenuEntryName="File" MenuItemName="Reload from Disk"/>
<Item MenuEntryName="File" MenuItemName="Print..."/>
<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"/>

<!-- id="0" is the separator -->
<Item id="0"/>
<Item MenuEntryName="File" MenuItemName="Rename..."/>
<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"/>
<Item MenuEntryName="Edit" MenuItemName="Clear Read-Only Flag"/>
<!-- id="0" is the separator -->
<Item id="0"/>

<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 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"/>
<Item MenuEntryName="Edit" MenuItemName="Set Read-Only"/>
<Item MenuEntryName="Edit" MenuItemName="Clear Read-Only Flag"/>

</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>

<!--
Expand Down

0 comments on commit 4bde0d4

Please sign in to comment.