Skip to content

Commit c9e0a25

Browse files
committed
Stop activating code panes on setting the selection
If that is desired, set the active selection or activate the module separately. All users of the ICodePane.Selection property have been scanned and amended.
1 parent f8cfbdc commit c9e0a25

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

Rubberduck.VBEditor.VBA/SafeComWrappers/VB/CodePane.cs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -90,35 +90,6 @@ private void SetSelection(int startLine, int startColumn, int endLine, int endCo
9090
return;
9191
}
9292
Target.SetSelection(startLine, startColumn, endLine, endColumn);
93-
ForceFocus();
94-
}
95-
96-
private void ForceFocus()
97-
{
98-
if (IsWrappingNullReference)
99-
{
100-
return;
101-
}
102-
103-
Show();
104-
105-
using (var vbe = VBE)
106-
using (var mainWindow = vbe.MainWindow)
107-
using (var window = Window)
108-
{
109-
var mainWindowHandle = mainWindow.Handle();
110-
var handle = mainWindow.Handle().FindChildWindow(window.Caption);
111-
112-
if (handle != IntPtr.Zero)
113-
{
114-
NativeMethods.ActivateWindow(handle, mainWindowHandle);
115-
}
116-
else
117-
{
118-
_logger.Debug(
119-
"CodePane.ForceFocus() failed to get a handle on the MainWindow.");
120-
}
121-
}
12293
}
12394

12495
public void Show()

0 commit comments

Comments
 (0)