Martijn Laan 1 gadu atpakaļ
vecāks
revīzija
8c3ec24afd
2 mainītis faili ar 7 papildinājumiem un 5 dzēšanām
  1. 4 4
      Projects/Src/CompForm.pas
  2. 3 1
      Projects/Src/CompScintEdit.pas

+ 4 - 4
Projects/Src/CompForm.pas

@@ -865,8 +865,8 @@ begin
   MemosTabSet.PopupMenu := TCompileFormPopupMenu.Create(Self, MemosTabSetPopupMenu);
 
   FNavStacks := TCompScintEditNavStacks.Create;
-  FCurrentNavItem.Invalidate;
   UpdateNavButtons;
+  FCurrentNavItem.Invalidate;
 
   BackNavButton.Style := tbsDropDown;
   BackNavButton.DropdownMenu := TCompileFormPopupMenu.Create(Self, NavPopupMenu);
@@ -1155,8 +1155,8 @@ begin
   FMainMemo.ClearUndo;
 
   FNavStacks.Clear;
-  FCurrentNavItem.Invalidate;
   UpdateNavButtons;
+  FCurrentNavItem.Invalidate;
 end;
 
 { Breakpoints are preserved on a per-file basis }
@@ -3700,8 +3700,8 @@ procedure TCompileForm.RemoveMemoBadLinesFromNav(const AMemo: TCompScintEdit);
 begin
   if FNavStacks.RemoveMemoBadLines(AMemo) then
     UpdateNavButtons;
- { We do NOT update FCurrentNav here so it might point to a line that's
-   deleted until next UpdateCaretPosPanelAndBackStack by UpdateMemoUI }
+  { We do NOT update FCurrentNav here so it might point to a line that's
+    deleted until next UpdateCaretPosPanelAndBackStack by UpdateMemoUI }
 end;
 
 procedure TCompileForm.UpdateNavButtons;

+ 3 - 1
Projects/Src/CompScintEdit.pas

@@ -262,7 +262,9 @@ end;
 procedure TCompScintEditNavStack.Optimize;
 begin
   { Turn two entries for the same memo and line which are next to each other
-    into one entry, ignoring column differences (like Visual Studio 2022) }
+    into one entry, ignoring column differences (like Visual Studio 2022)
+    Note: doesn't yet look at CompForm's FCurrentNavItem to see if a stack's top
+    item is the same so it doesnt optimize that situation atm }
   for var I := Count-1 downto 1 do
     if Items[I].EqualMemoAndLine(Items[I-1]) then
       Delete(I);