Menu

#25 Fix: Prevent Directory Tree from Resetting to Top

v1.0_(example)
closed-fixed
Zurd
None
5
2022-03-01
2022-02-26
LPS
No

First, extremely useful software. Thank you.

When the directory tree view on the left has many items (100s of subdirectories), it will reset to the top if you clicked over to the list of files and then clicked back in the directory tree view. i.e. Select a directory, go and rename the files, and then selecting another directory causes the tree view to reset to the top.

Googled and found this and it seems to have resolved the issue for me: https://stackoverflow.com/questions/49192052/treeview-jumps-to-top-on-selecting-or-editing-item

On line 318 in the "#Create the tree" section, changing
$sw_tree->add_with_viewport( $tv_tree );
to
$sw_tree->add( $tv_tree );

Not familiar with the underlying libraries but everything still seems to work fine for me after this adjustment.

Discussion

  • Zurd

    Zurd - 2022-02-26

    Awesome! Everything is there, easy patch. I can confirm this bug. I just released the new version. I've removed all 4 references of with_viewport since he said on SO that it is deprecated since 3.8.

    Thanks for all the information!

     
  • Zurd

    Zurd - 2022-02-26
    • status: open --> closed-fixed
    • assigned_to: Zurd
     
  • LPS

    LPS - 2022-03-01

    I'd just like to extend my thanks to you again, Zurd. You've saved me dozens of hours, and that matters. Keep up the great work.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.