private static void ShowBreakpointSourceLocation(FileLocation location) { if (lastLocation != null && lastLocation.IsSame(location)) { return; } lastLocation = location; ClearDebuggingMarkers(); Npp.PlaceIndicator(INDICATOR_DEBUGSTEP, location.Start, location.End); Npp.PlaceMarker(MARK_DEBUGSTEP, location.Line); int start = Npp.GetFirstVisibleLine(); int end = start + Npp.GetLinesOnScreen(); if (location.Line > end || location.Line < start) { Npp.SetFirstVisibleLine(Math.Max(location.Line - (end - start) / 2, 0)); } Npp.SetCaretPosition(location.Start); Npp.ClearSelection(); //need this one as otherwise parasitic selection can be triggered Win32.SetForegroundWindow(Npp.NppHandle); }
private static void ProcessOpenStackLocation(string sourceLocation) { var location = Debugger.FileLocation.Parse(sourceLocation); int start = Npp.GetFirstVisibleLine(); int end = start + Npp.GetLinesOnScreen(); if (location.Line > end || location.Line < start) { Npp.SetFirstVisibleLine(Math.Max(location.Line - (end - start) / 2, 0)); } Npp.SetCaretPosition(location.Start); Npp.ClearSelection(); //need this one as otherwise parasitic selection can be triggered Win32.SetForegroundWindow(Npp.NppHandle); Win32.SetForegroundWindow(Npp.CurrentScintilla); }