File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1310,6 +1310,7 @@ class CMUSHclientDoc : public CDocument
1310
1310
map<long , WORD> m_AcceleratorToCommandMap; // command to send for accelerator
1311
1311
map<WORD, string> m_CommandToMacroMap; // what that command does
1312
1312
map<WORD, short > m_CommandToSendToMap; // where it goes (eg. 0 = world, 1 = command etc.)
1313
+ map<WORD, string> m_CommandToPluginMap; // what plugin it belongs to
1313
1314
HACCEL m_accelerator;
1314
1315
1315
1316
// for mapping colours to colours
Original file line number Diff line number Diff line change @@ -133,6 +133,12 @@ WORD key;
133
133
// and where to send it
134
134
m_CommandToSendToMap [command] = SendTo;
135
135
136
+ // remember which plugin did it
137
+ m_CommandToPluginMap [command].empty ();
138
+
139
+ if (m_CurrentPlugin)
140
+ m_CommandToPluginMap [command] = m_CurrentPlugin->m_strID ;
141
+
136
142
} // end of having something to do (ie. not deleting accelerator)
137
143
138
144
// create new handle
Original file line number Diff line number Diff line change @@ -2535,6 +2535,11 @@ void CSendView::OnAcceleratorCommand (UINT nID)
2535
2535
CString strExtraOutput;
2536
2536
pDoc->m_iCurrentActionSource = eUserAccelerator;
2537
2537
2538
+ CPlugin * pSavedPlugin = pDoc->m_CurrentPlugin ;
2539
+
2540
+ // which plugin wanted it
2541
+ pDoc->m_CurrentPlugin = pDoc->GetPlugin (pDoc->m_CommandToPluginMap [nID].c_str ());
2542
+
2538
2543
// ok let's do it now
2539
2544
pDoc->SendTo (pDoc->m_CommandToSendToMap [nID],
2540
2545
sCommand .c_str (),
@@ -2545,6 +2550,8 @@ void CSendView::OnAcceleratorCommand (UINT nID)
2545
2550
strExtraOutput // if we sent to output, it goes here
2546
2551
);
2547
2552
2553
+ pDoc->m_CurrentPlugin = pSavedPlugin;
2554
+
2548
2555
// display any stuff sent to output window
2549
2556
2550
2557
if (!strExtraOutput.IsEmpty ())
You can’t perform that action at this time.
0 commit comments