View Issue Details

IDProjectCategoryView StatusLast Update
0000836Double CommanderGraphical user interfacepublic2021-10-29 23:21
Reportervitaliyg Assigned ToAlexx2000  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
ProjectionnoneETAnone 
Product Version0.6.0 (trunk) 
Target Version0.9.0Fixed in Version0.9.0 
Summary0000836: [patch] Restore scroll position after file list refresh
DescriptionThis patch is intended to resolve unexpected and annoying "scroll down"(focused file is scrolled to the last visible line) of files list after refresh, drag&drop to/from DC
TagsNo tags attached.
Attached Files
RestoreScrollPos.patch (11,106 bytes)   
Index: src/fileviews/ucolumnsfileview.pas
===================================================================
--- src/fileviews/ucolumnsfileview.pas	(revision 5463)
+++ src/fileviews/ucolumnsfileview.pas	(working copy)
@@ -142,7 +142,7 @@
     procedure RedrawFile(FileIndex: PtrInt); override;
     procedure RedrawFile(DisplayFile: TDisplayFile); override;
     procedure RedrawFiles; override;
-    procedure SetActiveFile(FileIndex: PtrInt); override;
+    procedure SetActiveFile(FileIndex, aLastTopRowIndex: PtrInt); override;
     procedure SetSorting(const NewSortings: TFileSortings); override;
     procedure ShowRenameFileEdit(aFile: TFile); override;
 
@@ -385,11 +385,13 @@
 {$IF lcl_fullversion >= 093100}
   dgPanel.Options := dgPanel.Options - [goDontScrollPartCell];
 {$ENDIF}
-  DoFileIndexChanged(aRow - dgPanel.FixedRows);
+  DoFileIndexChanged(aRow - dgPanel.FixedRows, dgPanel.TopRow);
 end;
 
 procedure TColumnsFileView.dgPanelTopLeftChanged(Sender: TObject);
 begin
+  if not FUpdatingActiveFile then
+    DoFileIndexChanged(dgPanel.Row - dgPanel.FixedRows, dgPanel.TopRow);
   Notify([fvnVisibleFilePropertiesChanged]);
 end;
 
@@ -599,7 +601,8 @@
   begin
     AVisibleRows := GetFullVisibleRows;
     if iRow < AVisibleRows.First then
-      TopRow := AVisibleRows.First;
+      TopRow := iRow
+    else
     if iRow > AVisibleRows.Last then
       TopRow := iRow - (AVisibleRows.Last - AVisibleRows.First);
   end;
@@ -611,9 +614,11 @@
     MakeVisible(dgPanel.Row);
 end;
 
-procedure TColumnsFileView.SetActiveFile(FileIndex: PtrInt);
+procedure TColumnsFileView.SetActiveFile(FileIndex, aLastTopRowIndex: PtrInt);
 begin
   dgPanel.Row := FileIndex + dgPanel.FixedRows;
+  if (aLastTopRowIndex <> -1) then
+    dgPanel.TopRow := aLastTopRowIndex;
   MakeVisible(dgPanel.Row);
 end;
 
@@ -832,10 +837,10 @@
   SetFilesDisplayItems;
   RedrawFiles;
 
-  if SetActiveFileNow(RequestedActiveFile) then
+  if SetActiveFileNow(RequestedActiveFile, FLastTopRowIndex) then
     RequestedActiveFile := ''
   // Requested file was not found, restore position to last active file.
-  else if not SetActiveFileNow(LastActiveFile) then
+  else if not SetActiveFileNow(LastActiveFile, FLastTopRowIndex) then
   // Make sure at least that the previously active file is still visible after displaying file list.
     MakeActiveVisible;
 
Index: src/fileviews/ufileviewwithgrid.pas
===================================================================
--- src/fileviews/ufileviewwithgrid.pas	(revision 5463)
+++ src/fileviews/ufileviewwithgrid.pas	(working copy)
@@ -76,7 +76,7 @@
     procedure RedrawFile(FileIndex: PtrInt); override;
     procedure RedrawFile(DisplayFile: TDisplayFile); override;
     procedure RedrawFiles; override;
-    procedure SetActiveFile(FileIndex: PtrInt); override;
+    procedure SetActiveFile(FileIndex, aLastTopRowIndex: PtrInt); override;
     procedure DoFileUpdated(AFile: TDisplayFile; UpdatedProperties: TFilePropertiesTypes = []); override;
     procedure DoHandleKeyDown(var Key: Word; Shift: TShiftState); override;
     procedure UpdateInfoPanel; override;
@@ -428,11 +428,11 @@
   dgPanel.CalculateColumnWidth;
   SetFilesDisplayItems;
 
-  if SetActiveFileNow(RequestedActiveFile) then
+  if SetActiveFileNow(RequestedActiveFile, FLastTopRowIndex) then
     RequestedActiveFile := ''
   else
     // Requested file was not found, restore position to last active file.
-    SetActiveFileNow(LastActiveFile);
+    SetActiveFileNow(LastActiveFile, FLastTopRowIndex);
 
   Notify([fvnVisibleFilePropertiesChanged]);
 
@@ -606,7 +606,7 @@
   TabHeader.UpdateSorting(Sorting);
 end;
 
-procedure TFileViewWithGrid.SetActiveFile(FileIndex: PtrInt);
+procedure TFileViewWithGrid.SetActiveFile(FileIndex, aLastTopRowIndex: PtrInt);
 var
   ACol, ARow: Integer;
 begin
@@ -652,7 +652,7 @@
 
 procedure TFileViewWithGrid.dgPanelSelection(Sender: TObject; aCol, aRow: Integer);
 begin
-  DoFileIndexChanged(dgPanel.CellToIndex(aCol, aRow));
+  DoFileIndexChanged(dgPanel.CellToIndex(aCol, aRow), dgPanel.TopRow);
   UpdateFooterDetails;
 end;
 
Index: src/fileviews/ufileviewwithmainctrl.pas
===================================================================
--- src/fileviews/ufileviewwithmainctrl.pas	(revision 5463)
+++ src/fileviews/ufileviewwithmainctrl.pas	(working copy)
@@ -585,7 +585,7 @@
     case Button of
       mbRight:
       begin
-        SetActiveFile(FileIndex);
+        SetActiveFile(FileIndex, -1);
 
         if gMouseSelectionEnabled and (gMouseSelectionButton = 1) then
         begin
@@ -627,7 +627,7 @@
         end;//of mouse selection handler
       end;
     else
-      SetActiveFile(FileIndex);
+      SetActiveFile(FileIndex, -1);
     end;
 
     { Dragging }
@@ -758,7 +758,7 @@
         SelEndIndex := FMouseSelectionStartIndex;
       end;
 
-      SetActiveFile(FileIndex);
+      SetActiveFile(FileIndex, -1);
       MarkFiles(SelStartIndex, SelEndIndex, FMouseSelectionLastState);
     end;
   end;
Index: src/fileviews/uorderedfileview.pas
===================================================================
--- src/fileviews/uorderedfileview.pas	(revision 5463)
+++ src/fileviews/uorderedfileview.pas	(working copy)
@@ -54,7 +54,8 @@
   protected
     lblFilter: TLabel;
     quickSearch: TfrmQuickSearch;
-    FLastActiveFileIndex: Integer;
+    FLastActiveFileIndex: PtrInt;
+    FLastTopRowIndex: PtrInt;
     FRangeSelecting: Boolean;
     FRangeSelectionStartIndex: Integer;
     FRangeSelectionEndIndex: Integer;
@@ -63,7 +64,7 @@
     procedure InvertActiveFile;
     procedure AfterChangePath; override;
     procedure CreateDefault(AOwner: TWinControl); override;
-    procedure DoFileIndexChanged(NewFileIndex: PtrInt);
+    procedure DoFileIndexChanged(NewFileIndex, TopRowIndex: PtrInt);
     procedure DoHandleKeyDown(var Key: Word; Shift: TShiftState); override;
     procedure DoHandleKeyDownWhenLoading(var Key: Word; Shift: TShiftState); override;
     procedure DoSelectionChanged; override; overload;
@@ -89,13 +90,13 @@
                          SearchDirection: TQuickSearchDirection = qsdNone);
     procedure Selection(Key: Word; CurIndex: PtrInt);
     procedure SelectRange(FileIndex: PtrInt);
-    procedure SetActiveFile(FileIndex: PtrInt); overload; virtual; abstract;
-    procedure SetLastActiveFile(FileIndex: PtrInt);
+    procedure SetActiveFile(FileIndex, aLastTopRowIndex: PtrInt); overload; virtual; abstract;
+    procedure SetLastActiveFile(FileIndex, TopRowIndex: PtrInt);
     {en
        Sets a file as active if the file currently exists.
        @returns(@true if the file was found and selected.)
     }
-    function SetActiveFileNow(aFilePath: String): Boolean;
+    function SetActiveFileNow(aFilePath: String; aLastTopRowIndex: PtrInt): Boolean;
 
   public
     procedure CloneTo(AFileView: TFileView); override;
@@ -158,7 +159,7 @@
   if not (IsEmpty or IsLoadingFileList) then
   begin
     SetFocus;
-    SetActiveFile(0);
+    SetActiveFile(0, -1);
   end;
 end;
 
@@ -167,7 +168,7 @@
   if not (IsEmpty or IsLoadingFileList) then
   begin
     SetFocus;
-    SetActiveFile(FFiles.Count - 1);
+    SetActiveFile(FFiles.Count - 1, -1);
   end;
 end;
 
@@ -209,9 +210,13 @@
   pmOperationsCancel.Parent := Self;
 end;
 
-procedure TOrderedFileView.DoFileIndexChanged(NewFileIndex: PtrInt);
+procedure TOrderedFileView.DoFileIndexChanged(NewFileIndex, TopRowIndex: PtrInt);
 begin
-  if IsFileIndexInRange(NewFileIndex) and (FLastActiveFileIndex <> NewFileIndex) then
+  if IsFileIndexInRange(NewFileIndex) and
+     ( (FLastActiveFileIndex <> NewFileIndex) or
+       (FLastTopRowIndex <> TopRowIndex)
+     )
+  then
   begin
     if not FRangeSelecting then
     begin
@@ -223,7 +228,7 @@
 
     if not FUpdatingActiveFile then
     begin
-      SetLastActiveFile(NewFileIndex);
+      SetLastActiveFile(NewFileIndex, TopRowIndex);
 
       if Assigned(OnChangeActiveFile) then
         OnChangeActiveFile(Self, FFiles[NewFileIndex].FSFile);
@@ -582,7 +587,7 @@
 
       if Result then
       begin
-        SetActiveFile(Index);
+        SetActiveFile(Index, -1);
         Exit;
       end;
 
@@ -685,7 +690,7 @@
   begin
     // First try to select the file in the current file list.
     // If not found save it for later selection (possibly after reload).
-    if SetActiveFileNow(aFilePath) then
+    if SetActiveFileNow(aFilePath, -1) then
       RequestedActiveFile := ''
     else
       RequestedActiveFile := aFilePath;
@@ -692,50 +697,41 @@
   end;
 end;
 
-function TOrderedFileView.SetActiveFileNow(aFilePath: String): Boolean;
+function TOrderedFileView.SetActiveFileNow(aFilePath: String; aLastTopRowIndex: PtrInt): Boolean;
 var
   Index: PtrInt;
+  PathIsAbsolute: Boolean;
 begin
   if aFilePath <> '' then // find correct cursor position in Panel (drawgrid)
   begin
-    if FileSource.GetPathType(aFilePath) = ptAbsolute then
+    PathIsAbsolute := FileSource.GetPathType(aFilePath) = ptAbsolute;
+    for Index := 0 to FFiles.Count - 1 do
     begin
-      for Index := 0 to FFiles.Count - 1 do
+      if PathIsAbsolute then
+        Result := (FFiles[Index].FSFile.FullPath = aFilePath)
+      else
+        Result := (FFiles[Index].FSFile.Name = aFilePath);
+
+      if Result then
       begin
-        if FFiles[Index].FSFile.FullPath = aFilePath then
-        begin
-          FUpdatingActiveFile := True;
-          SetActiveFile(Index);
-          FUpdatingActiveFile := False;
-          SetLastActiveFile(Index);
-          Exit(True);
-        end;
+        FUpdatingActiveFile := True;
+        SetActiveFile(Index, aLastTopRowIndex);
+        FUpdatingActiveFile := False;
+        SetLastActiveFile(Index, aLastTopRowIndex);
+        Exit;
       end;
-    end
-    else
-    begin
-      for Index := 0 to FFiles.Count - 1 do
-      begin
-        if FFiles[Index].FSFile.Name = aFilePath then
-        begin
-          FUpdatingActiveFile := True;
-          SetActiveFile(Index);
-          FUpdatingActiveFile := False;
-          SetLastActiveFile(Index);
-          Exit(True);
-        end;
-      end;
     end;
   end;
   Result := False;
 end;
 
-procedure TOrderedFileView.SetLastActiveFile(FileIndex: PtrInt);
+procedure TOrderedFileView.SetLastActiveFile(FileIndex, TopRowIndex: PtrInt);
 begin
   if IsFileIndexInRange(FileIndex) then
   begin
     LastActiveFile := FFiles[FileIndex].FSFile.FullPath;
     FLastActiveFileIndex := FileIndex;
+    FLastTopRowIndex := TopRowIndex;
   end;
 end;
 
Index: src/fviewoperations.pas
===================================================================
--- src/fviewoperations.pas	(revision 5463)
+++ src/fviewoperations.pas	(working copy)
@@ -1,4 +1,4 @@
-unit fViewOperations; 
+unit fViewOperations;
 
 {$mode objfpc}{$H+}
 
@@ -863,7 +863,7 @@
       Pen.Style := psSolid;
 
       HalfSize := ExpandSignSize shr 1;
-      if ((ExpandSignSize and 1) = 0) then
+      if not Odd(ExpandSignSize) then
         dec(HalfSize);
       ALeft := MidX - HalfSize;
       ATop := MidY - HalfSize;
RestoreScrollPos.patch (11,106 bytes)   
patchDook.diff (9,326 bytes)   
Index: src/fileviews/ucolumnsfileview.pas
===================================================================
--- src/fileviews/ucolumnsfileview.pas	(revision 8064)
+++ src/fileviews/ucolumnsfileview.pas	(working copy)
@@ -164,7 +164,7 @@
     procedure RedrawFile(FileIndex: PtrInt); override;
     procedure RedrawFile(DisplayFile: TDisplayFile); override;
     procedure RedrawFiles; override;
-    procedure SetActiveFile(FileIndex: PtrInt; ScrollTo: Boolean); override;
+    procedure SetActiveFile(FileIndex: PtrInt; ScrollTo: Boolean; aLastTopRowIndex: PtrInt = -1); override;
     procedure SetSorting(const NewSortings: TFileSortings); override;
     procedure ShowRenameFileEdit(aFile: TFile); override;
     procedure UpdateRenameFileEditPosition; override;
@@ -416,11 +416,12 @@
 {$IF lcl_fullversion >= 093100}
   dgPanel.Options := dgPanel.Options - [goDontScrollPartCell];
 {$ENDIF}
-  DoFileIndexChanged(aRow - dgPanel.FixedRows);
+  DoFileIndexChanged(aRow - dgPanel.FixedRows, dgPanel.TopRow);
 end;
 
 procedure TColumnsFileView.dgPanelTopLeftChanged(Sender: TObject);
 begin
+  if not FUpdatingActiveFile then DoFileIndexChanged(dgPanel.Row - dgPanel.FixedRows, dgPanel.TopRow);
   Notify([fvnVisibleFilePropertiesChanged]);
 end;
 
@@ -679,7 +680,7 @@
   begin
     AVisibleRows := GetFullVisibleRows;
     if iRow < AVisibleRows.First then
-      TopRow := AVisibleRows.First;
+     TopRow := iRow;
     if iRow > AVisibleRows.Last then
       TopRow := iRow - (AVisibleRows.Last - AVisibleRows.First);
   end;
@@ -691,12 +692,13 @@
     MakeVisible(dgPanel.Row);
 end;
 
-procedure TColumnsFileView.SetActiveFile(FileIndex: PtrInt; ScrollTo: Boolean);
+procedure TColumnsFileView.SetActiveFile(FileIndex: PtrInt; ScrollTo: Boolean; aLastTopRowIndex: PtrInt = -1);
 begin
   if not ScrollTo then
     dgPanel.SetColRow(dgPanel.Col, FileIndex + dgPanel.FixedRows)
   else begin
     dgPanel.Row := FileIndex + dgPanel.FixedRows;
+    if (aLastTopRowIndex <> -1) then dgPanel.TopRow := aLastTopRowIndex;
     MakeVisible(dgPanel.Row);
   end;
 end;
@@ -905,10 +907,10 @@
   SetFilesDisplayItems;
   RedrawFiles;
 
-  if SetActiveFileNow(RequestedActiveFile) then
+  if SetActiveFileNow(RequestedActiveFile, FLastTopRowIndex) then
     RequestedActiveFile := ''
   // Requested file was not found, restore position to last active file.
-  else if not SetActiveFileNow(LastActiveFile) then
+  else if not SetActiveFileNow(LastActiveFile, FLastTopRowIndex) then
   // Make sure at least that the previously active file is still visible after displaying file list.
     MakeActiveVisible;
 
Index: src/fileviews/ufileviewwithgrid.pas
===================================================================
--- src/fileviews/ufileviewwithgrid.pas	(revision 8064)
+++ src/fileviews/ufileviewwithgrid.pas	(working copy)
@@ -83,7 +83,7 @@
     procedure RedrawFile(FileIndex: PtrInt); override;
     procedure RedrawFile(DisplayFile: TDisplayFile); override;
     procedure RedrawFiles; override;
-    procedure SetActiveFile(FileIndex: PtrInt; ScrollTo: Boolean); override;
+    procedure SetActiveFile(FileIndex: PtrInt; ScrollTo: Boolean; aLastTopRowIndex: PtrInt = -1); override;
     procedure DoFileUpdated(AFile: TDisplayFile; UpdatedProperties: TFilePropertiesTypes = []); override;
     procedure DoHandleKeyDown(var Key: Word; Shift: TShiftState); override;
     procedure UpdateFlatFileName; override;
@@ -524,11 +524,11 @@
   dgPanel.CalculateColumnWidth;
   SetFilesDisplayItems;
 
-  if SetActiveFileNow(RequestedActiveFile) then
+  if SetActiveFileNow(RequestedActiveFile, FLastTopRowIndex) then
     RequestedActiveFile := ''
   else
     // Requested file was not found, restore position to last active file.
-    SetActiveFileNow(LastActiveFile);
+    SetActiveFileNow(LastActiveFile, FLastTopRowIndex);
 
   Notify([fvnVisibleFilePropertiesChanged]);
 
@@ -703,7 +703,7 @@
   TabHeader.UpdateSorting(Sorting);
 end;
 
-procedure TFileViewWithGrid.SetActiveFile(FileIndex: PtrInt; ScrollTo: Boolean);
+procedure TFileViewWithGrid.SetActiveFile(FileIndex: PtrInt; ScrollTo: Boolean; aLastTopRowIndex: PtrInt = -1);
 var
   ACol, ARow: Integer;
 begin
@@ -756,7 +756,7 @@
 
 procedure TFileViewWithGrid.dgPanelSelection(Sender: TObject; aCol, aRow: Integer);
 begin
-  DoFileIndexChanged(dgPanel.CellToIndex(aCol, aRow));
+  DoFileIndexChanged(dgPanel.CellToIndex(aCol, aRow), dgPanel.TopRow);
   UpdateFooterDetails;
 end;
 
Index: src/fileviews/uorderedfileview.pas
===================================================================
--- src/fileviews/uorderedfileview.pas	(revision 8064)
+++ src/fileviews/uorderedfileview.pas	(working copy)
@@ -54,7 +54,8 @@
   protected
     lblFilter: TLabel;
     quickSearch: TfrmQuickSearch;
-    FLastActiveFileIndex: Integer;
+    FLastActiveFileIndex: PtrInt;
+    FLastTopRowIndex: PtrInt;
     FRangeSelecting: Boolean;
     FRangeSelectionStartIndex: Integer;
     FRangeSelectionEndIndex: Integer;
@@ -63,7 +64,7 @@
     procedure InvertActiveFile;
     procedure AfterChangePath; override;
     procedure CreateDefault(AOwner: TWinControl); override;
-    procedure DoFileIndexChanged(NewFileIndex: PtrInt);
+    procedure DoFileIndexChanged(NewFileIndex, TopRowIndex: PtrInt);
     procedure DoHandleKeyDown(var Key: Word; Shift: TShiftState); override;
     procedure DoHandleKeyDownWhenLoading(var Key: Word; Shift: TShiftState); override;
     procedure DoSelectionChanged; override; overload;
@@ -87,13 +88,13 @@
     procedure SearchFile(SearchTerm,SeparatorCharset: String; SearchOptions: TQuickSearchOptions; InvertSelection: Boolean = False);
     procedure Selection(Key: Word; CurIndex: PtrInt);
     procedure SelectRange(FileIndex: PtrInt);
-    procedure SetActiveFile(FileIndex: PtrInt; ScrollTo: Boolean = True); overload; virtual; abstract;
-    procedure SetLastActiveFile(FileIndex: PtrInt);
+    procedure SetActiveFile(FileIndex: PtrInt; ScrollTo: Boolean = True; aLastTopRowIndex: PtrInt = -1); overload; virtual; abstract;
+    procedure SetLastActiveFile(FileIndex, TopRowIndex: PtrInt);
     {en
        Sets a file as active if the file currently exists.
        @returns(@true if the file was found and selected.)
     }
-    function SetActiveFileNow(aFilePath: String): Boolean;
+    function SetActiveFileNow(aFilePath: String; aLastTopRowIndex: PtrInt = -1): Boolean;
 
   public
     procedure CloneTo(AFileView: TFileView); override;
@@ -210,9 +211,9 @@
   pmOperationsCancel.Parent := Self;
 end;
 
-procedure TOrderedFileView.DoFileIndexChanged(NewFileIndex: PtrInt);
+procedure TOrderedFileView.DoFileIndexChanged(NewFileIndex, TopRowIndex: PtrInt);
 begin
-  if IsFileIndexInRange(NewFileIndex) and (FLastActiveFileIndex <> NewFileIndex) then
+  if IsFileIndexInRange(NewFileIndex) and ( (FLastActiveFileIndex <> NewFileIndex) or (FLastTopRowIndex <> TopRowIndex) ) then
   begin
     if not FRangeSelecting then
     begin
@@ -224,8 +225,7 @@
 
     if not FUpdatingActiveFile then
     begin
-      SetLastActiveFile(NewFileIndex);
-
+      SetLastActiveFile(NewFileIndex, TopRowIndex);
       if Assigned(OnChangeActiveFile) then
         OnChangeActiveFile(Self, FFiles[NewFileIndex].FSFile);
     end;
@@ -780,54 +780,45 @@
   end;
 end;
 
-
-function TOrderedFileView.SetActiveFileNow(aFilePath: String): Boolean;
-
+function TOrderedFileView.SetActiveFileNow(aFilePath: String; aLastTopRowIndex: PtrInt = -1): Boolean;
   procedure SetUpdate(Index: PtrInt);
   begin
     FUpdatingActiveFile := True;
-    SetActiveFile(Index);
+    SetActiveFile(Index, True, aLastTopRowIndex);
     FUpdatingActiveFile := False;
-    SetLastActiveFile(Index);
+    SetLastActiveFile(Index, aLastTopRowIndex);
   end;
 
 var
   Index: PtrInt;
+  PathIsAbsolute: Boolean;
 begin
   if aFilePath <> '' then // find correct cursor position in Panel (drawgrid)
   begin
-    if FileSource.GetPathType(aFilePath) = ptAbsolute then
-    begin
-      for Index := 0 to FFiles.Count - 1 do
-      begin
-        if FFiles[Index].FSFile.FullPath = aFilePath then
-        begin
-          SetUpdate(Index);
-          Exit(True);
-        end;
-      end;
-    end
-    else
+    PathIsAbsolute := FileSource.GetPathType(aFilePath) = ptAbsolute;
+    for Index := 0 to FFiles.Count - 1 do
     begin
-      for Index := 0 to FFiles.Count - 1 do
+      if PathIsAbsolute then
+        Result := (FFiles[Index].FSFile.FullPath = aFilePath)
+      else
+        Result := (FFiles[Index].FSFile.Name = aFilePath);
+      if Result then
       begin
-        if FFiles[Index].FSFile.Name = aFilePath then
-        begin
           SetUpdate(Index);
           Exit(True);
-        end;
       end;
     end;
   end;
   Result := False;
 end;
 
-procedure TOrderedFileView.SetLastActiveFile(FileIndex: PtrInt);
+procedure TOrderedFileView.SetLastActiveFile(FileIndex, TopRowIndex: PtrInt);
 begin
   if IsFileIndexInRange(FileIndex) then
   begin
     LastActiveFile := FFiles[FileIndex].FSFile.FullPath;
     FLastActiveFileIndex := FileIndex;
+    FLastTopRowIndex := TopRowIndex;
   end;
 end;
 
patchDook.diff (9,326 bytes)   
Fixed in Revision8069
Operating system
Widgetset
Architecture

Relationships

related to 0002301 confirmedAlexx2000 Scroll position jumps to selection after directory update if the selected file has changed position 

Activities

Alexx2000

2014-05-15 19:51

administrator   ~0001257

This patch is buggy. It causes an error (list index out of bounds) when create new tab, Alt+Z, change directory etc. See for example: http://doublecmd.sourceforge.net/forum/viewtopic.php?f=10&t=2351

cordylus

2017-02-12 16:12

developer   ~0002089

Hi, vitaliyg. Are you planning to finish this work? It would be great to see this fixed.

vitaliyg

2017-02-12 19:33

developer   ~0002090

Hi cordylus, maybe I'll find some time for this next week

cordylus

2017-02-12 19:43

developer   ~0002091

Thanks, I'll look forward to it.

Dook

2018-04-15 21:50

reporter   ~0002567

I rewrote vitaliyg patch. No buggs. Patch attached.

cordylus

2018-10-20 05:50

developer   ~0002801

It doesn't seem to be fixed at all, just tested on r8354. Windows XP here, if that matters.

cordylus

2018-11-06 05:04

developer   ~0002867

Переоткрываю, так как, по-моему, ошибка не исправлена. Возможно, я подразумеваю другую ошибку, своё видение этой проблемы описал здесь: https://doublecmd.sourceforge.io/forum/viewtopic.php?p=25024#p25024

Пока что мне вообще непонятно, что же исправлено в патче.

Alexx2000

2018-11-25 13:48

administrator   ~0002942

В патче исправлена следующая ситуация: если длинный список файлов перемотать например в середину, установить курсор в средней части панели и нажать Ctrl+R то файл под курсором окажется внизу экрана. Легко повторить в версии 0.8.4.

Alexx2000

2018-12-10 09:01

administrator   ~0002969

Предлагаю вышеописанную проблему оформить отдельным багом.

Issue History

Date Modified Username Field Change
2014-02-16 22:11 vitaliyg New Issue
2014-02-16 22:11 vitaliyg File Added: RestoreScrollPos.patch
2014-05-06 20:47 Alexx2000 Fixed in Revision => 5504
2014-05-06 20:47 Alexx2000 Assigned To => Alexx2000
2014-05-06 20:47 Alexx2000 Status new => resolved
2014-05-06 20:47 Alexx2000 Resolution open => fixed
2014-05-06 20:47 Alexx2000 Fixed in Version => 0.6.0
2014-05-06 20:47 Alexx2000 Target Version => 0.6.0
2014-05-15 19:51 Alexx2000 Fixed in Revision 5504 =>
2014-05-15 19:51 Alexx2000 Note Added: 0001257
2014-05-15 19:51 Alexx2000 Status resolved => feedback
2014-05-15 19:51 Alexx2000 Resolution fixed => reopened
2014-05-15 19:51 Alexx2000 Fixed in Version 0.6.0 =>
2014-05-15 19:51 Alexx2000 Target Version 0.6.0 =>
2017-02-12 16:12 cordylus Note Added: 0002089
2017-02-12 19:33 vitaliyg Note Added: 0002090
2017-02-12 19:33 vitaliyg Status feedback => assigned
2017-02-12 19:34 vitaliyg Assigned To Alexx2000 => vitaliyg
2017-02-12 19:43 cordylus Note Added: 0002091
2018-04-15 21:49 Dook File Added: patchDook.diff
2018-04-15 21:50 Dook Note Added: 0002567
2018-04-22 16:24 Alexx2000 Fixed in Revision => 8069
2018-04-22 16:24 Alexx2000 Assigned To vitaliyg => Alexx2000
2018-04-22 16:24 Alexx2000 Status assigned => resolved
2018-04-22 16:24 Alexx2000 Resolution reopened => fixed
2018-04-22 16:24 Alexx2000 Target Version => 0.9.0
2018-10-20 05:50 cordylus Note Added: 0002801
2018-11-06 05:04 cordylus Note Added: 0002867
2018-11-06 05:04 cordylus Status resolved => assigned
2018-11-06 05:04 cordylus Resolution fixed => reopened
2018-11-25 13:48 Alexx2000 Note Added: 0002942
2018-12-10 09:01 Alexx2000 Note Added: 0002969
2018-12-10 09:01 Alexx2000 Status assigned => resolved
2018-12-10 09:01 Alexx2000 Fixed in Version => 0.9.0
2018-12-10 09:01 Alexx2000 Resolution reopened => fixed
2019-06-14 20:50 cordylus Relationship added related to 0002301
2021-10-29 23:21 Alexx2000 Status resolved => closed