From 403e45b2c4e3f8b411f78cf7d9a41c08bb73b4ec Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Mon, 19 Jul 2021 12:46:37 -0300 Subject: [PATCH] Centers current line while debugging. It now centers the current line when using QuickNav too. --- source/ide/ide_methods.bas | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/source/ide/ide_methods.bas b/source/ide/ide_methods.bas index 4c546ae77..32187fbb8 100644 --- a/source/ide/ide_methods.bas +++ b/source/ide/ide_methods.bas @@ -695,6 +695,15 @@ FUNCTION ide2 (ignore) IdeDebugMode = 1 EnterDebugMode: + IF idehelp THEN + idewy = idewy + idesubwindow + idehelp = 0 + idesubwindow = 0 + skipdisplay = 0 + IdeSystem = 1 + retval = 1: GOSUB redrawItAll + END IF + idecompiling = 0 ready = 1 _RESIZE OFF @@ -1331,8 +1340,8 @@ FUNCTION ide2 (ignore) ideselect = 0 idecy = QuickNavHistory(QuickNavTotal).idecy idecx = QuickNavHistory(QuickNavTotal).idecx - idesy = QuickNavHistory(QuickNavTotal).idesy idesx = QuickNavHistory(QuickNavTotal).idesx + idecentercurrentline QuickNavTotal = QuickNavTotal - 1 GOTO ideloop END IF @@ -6312,6 +6321,7 @@ SUB DebugMode l = CVL(value$) idecy = l idefocusline = 0 + idecentercurrentline ideshowtext clearStatusWindow 1 IF cmd$ = "breakpoint" THEN @@ -7744,6 +7754,11 @@ FUNCTION idegetline$ (i) idegetline$ = MID$(idet$, ideli + 4, CVL(MID$(idet$, ideli, 4))) END FUNCTION +SUB idecentercurrentline + idesy = idecy - (idewy - 8) \ 2 + IF idesy < 1 THEN idesy = 1 +END SUB + SUB idegotoline (i) IF idel = i THEN EXIT SUB IF i < 1 THEN ERROR 5