Esempio n. 1
0
        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);
        }