Skip to content

Commit 0cd1b1f

Browse files
committed
Fixed bug regarding two plugins matching the same one-shot trigger/alias
1 parent 4349853 commit 0cd1b1f

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

ProcessPreviousLine.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,7 @@ assemble the full text of the original line.
894894

895895
int iDeletedCount = 0;
896896
int iDeletedNonTemporaryCount = 0;
897+
set<CPlugin *> pluginsWithDeletions;
897898

898899
for (OneShotItemMap::const_iterator one_shot_it = mapOneShotItems.begin ();
899900
one_shot_it != mapOneShotItems.end ();
@@ -922,11 +923,18 @@ assemble the full text of the original line.
922923
// now delete its entry
923924
GetTriggerMap ().RemoveKey (strTriggerName);
924925

926+
pluginsWithDeletions.insert (m_CurrentPlugin);
927+
925928
} // end of deleting one-shot items
926929

927930
if (iDeletedCount > 0)
928931
{
929-
SortTriggers ();
932+
// make sure we sort the correct plugin(s)
933+
for ( set<CPlugin *>::iterator i = pluginsWithDeletions.begin (); i != pluginsWithDeletions.end (); i++)
934+
{
935+
m_CurrentPlugin = *i;
936+
SortTriggers ();
937+
}
930938

931939
if (iDeletedNonTemporaryCount > 0) // plugin mods don't really count
932940
SetModifiedFlag (TRUE); // document has changed

evaluate.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ CAliasList AliasList;
177177

178178
int iDeletedCount = 0;
179179
int iDeletedNonTemporaryCount = 0;
180+
set<CPlugin *> pluginsWithDeletions;
180181

181182
for (OneShotItemMap::const_iterator one_shot_it = mapOneShotItems.begin ();
182183
one_shot_it != mapOneShotItems.end ();
@@ -205,11 +206,18 @@ CAliasList AliasList;
205206
// now delete its entry
206207
GetAliasMap ().RemoveKey (strAliasName);
207208

208-
} // end of deleting one-shot items
209+
pluginsWithDeletions.insert (m_CurrentPlugin);
210+
211+
} // end of deleting one-shot items
209212

210213
if (iDeletedCount > 0)
211214
{
212-
SortAliases ();
215+
// make sure we sort the correct plugin(s)
216+
for ( set<CPlugin *>::iterator i = pluginsWithDeletions.begin (); i != pluginsWithDeletions.end (); i++)
217+
{
218+
m_CurrentPlugin = *i;
219+
SortAliases ();
220+
}
213221

214222
if (iDeletedNonTemporaryCount > 0) // plugin mods don't really count
215223
SetModifiedFlag (TRUE); // document has changed

0 commit comments

Comments
 (0)