Skip to content

Commit 86d1ac3

Browse files
committed
Fix issue bruderstein#92, depends on update of N++ to a version > 7.5.8
, see also https://github.com/chcg/PythonScript/tree/issue_92 and N++ PR provided as notepad-plus-plus/notepad-plus-plus#4687
1 parent 491ad4f commit 86d1ac3

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

PythonScript/src/MenuManager.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,10 @@ void MenuManager::reconfigure()
777777

778778
}
779779

780+
void MenuManager::removeItem(int index)
781+
{
782+
BOOL removed = ::SendMessage(m_hNotepad, NPPM_REMOVESHORTCUTBYCMDID, static_cast<WPARAM>(m_funcItems[m_dynamicStartIndex + index - 1]._cmdID), 0);
783+
}
780784

781785
void MenuManager::configureToolbarIcons()
782786
{

PythonScript/src/MenuManager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class MenuManager
5353
void toolbarCommand(idx_t commandID);
5454

5555
void reconfigure();
56+
void removeItem(int index);
5657

5758
void refreshScriptsMenu();
5859

PythonScript/src/ShortcutDlg.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ void ShortcutDlg::removeMenuItem()
420420
{
421421
ListView_DeleteItem(m_hListMenuItems, index);
422422
m_menuItems.erase(m_menuItems.begin() + index);
423+
MenuManager::getInstance()->removeItem(index);
423424
}
424425

425426
--m_menuItemCount;

0 commit comments

Comments
 (0)