File tree Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -279,6 +279,11 @@ CMUSHView::CMUSHView()
279
279
m_selstart_col = 0 ;
280
280
m_selend_line = 0 ;
281
281
m_selend_col = 0 ;
282
+ m_old_selstart_line = 0 ;
283
+ m_old_selstart_col = 0 ;
284
+ m_old_selend_line = 0 ;
285
+ m_old_selend_col = 0 ;
286
+
282
287
m_freeze = FALSE ;
283
288
m_bAtBufferEnd = false ;
284
289
m_last_line_drawn = 0 ;
@@ -7648,14 +7653,27 @@ void CMUSHView::NotifySelectionChanged(void)
7648
7653
static bool bInSelectionChanged = false ;
7649
7654
if (bInSelectionChanged) // don't recurse into infinite loops
7650
7655
return ;
7656
+
7657
+ // we seem to get called when there wasn't really a change
7658
+ if ((m_selstart_line == m_old_selstart_line) &&
7659
+ (m_selstart_col == m_old_selstart_col) &&
7660
+ (m_selend_line == m_old_selend_line) &&
7661
+ (m_selend_col == m_old_selend_col))
7662
+ return ; // not really changed
7663
+
7664
+ m_old_selstart_line = m_selstart_line;
7665
+ m_old_selstart_col = m_selstart_col;
7666
+ m_old_selend_line = m_selend_line;
7667
+ m_old_selend_col = m_selend_col;
7668
+
7651
7669
bInSelectionChanged = true ;
7652
-
7670
+
7653
7671
CMUSHclientDoc* pDoc = GetDocument ();
7654
7672
ASSERT_VALID (pDoc);
7655
7673
7656
7674
if (pDoc->m_ScriptEngine )
7657
7675
pDoc->SendToAllPluginCallbacks (ON_PLUGIN_SELECTION_CHANGED);
7658
-
7676
+
7659
7677
bInSelectionChanged = false ;
7660
7678
// end of notify plugins
7661
7679
}
Original file line number Diff line number Diff line change @@ -46,6 +46,11 @@ class CMUSHView : public CView
46
46
m_pin_line, // this is where they started a selection (with the initial mouse down)
47
47
m_pin_col;
48
48
49
+ int m_old_selstart_line, // previous start of current selection
50
+ m_old_selstart_col,
51
+ m_old_selend_line, // previous end of current selection
52
+ m_old_selend_col;
53
+
49
54
int m_iPauseStatus;
50
55
51
56
BOOL m_freeze;
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ string PluginCallbacksNames [] = {
133
133
ON_PLUGIN_PLAYSOUND,
134
134
ON_PLUGIN_SAVE_STATE,
135
135
ON_PLUGIN_SCREENDRAW,
136
- ON_PLUGIN_SELECTION_CHANGED,
136
+ ON_PLUGIN_SELECTION_CHANGED,
137
137
ON_PLUGIN_SEND,
138
138
ON_PLUGIN_SENT,
139
139
ON_PLUGIN_TABCOMPLETE,
You can’t perform that action at this time.
0 commit comments