SublimeFileBrowser icon indicating copy to clipboard operation
SublimeFileBrowser copied to clipboard

Sublime Text 4 folder collapsing bug

Open bbassett opened this issue 4 years ago • 7 comments

I'm not sure the best way to describe it, so i've set up an example and captured screenshots. This is with sublime build 4107, and i've ensured that SublimeFileBrowser is up to date.

example folders expanded: Screenshot from 2021-06-16 22-42-50

then if I collapse folder bravo_one, Notice the doubled up carrots next to that folder. Screenshot from 2021-06-16 22-42-57

then if I do a refresh (r hotkey): Screenshot from 2021-06-16 22-43-02

bbassett avatar Jun 17 '21 04:06 bbassett

the workaround I found was to force a reload when you collapse. it's real heavy handed, but I haven't had the time to dig in deeper.

index d12ca3d..3914c4b 100644
--- a/dired.py
+++ b/dired.py
@@ -582,6 +582,7 @@ class DiredFold(TextCommand, DiredBaseCommand):
     Very important, in case of actual modification of view, set valid dired_index setting
                     see DiredRefreshCommand docs for details
     '''
+
     def run(self, edit, update=None, index=None):
         '''
         update
@@ -698,6 +699,7 @@ class DiredFold(TextCommand, DiredBaseCommand):
         v.erase(edit, indented_region)
         v.set_read_only(True)
         emit_event(u'fold', (self.view.id(), self.index[start_line - 1]), view=self.view)
+        v.run_command('dired_refresh')


 class DiredUpCommand(TextCommand, DiredBaseCommand):

bbassett avatar Jun 17 '21 05:06 bbassett

Why is this still needed in Sublime 4... I would ditch all other editors if they simply made the sidebar at least capable of switching sides...

Ontopic avatar Jul 15 '21 19:07 Ontopic

I believe this bug is fixed in gwenzek's fork of this repo. Working great for me.

I was also getting disappearing entries when I press the left arrow key. The gwenzek fork fixes this for me.

YBPN avatar Aug 09 '21 22:08 YBPN

Why is this still needed in Sublime 4... I would ditch all other editors if they simply made the sidebar at least capable of switching sides...

This is still better (faster) if you like to do everything by keyboard.

YBPN avatar Aug 19 '21 07:08 YBPN

I believe this bug is fixed in gwenzek's fork of this repo. Working great for me.

I was also getting disappearing entries when I press the left arrow key. The gwenzek fork fixes this for me.

I tried installing the fork but that didnt work for me, error saying cannot iterate over None object. I downloaded the zip file from repo and renamed it with FileBrowser.sublime-package and added it in my Packages folder. Is that how fork installation of package is done ?

abdulrahman004 avatar Sep 25 '21 20:09 abdulrahman004

i just did git -clone in terminal, in the packages/user directory.

git -clone https://github.com/gwenzek/SublimeFileBrowser.git

YBPN avatar Sep 26 '21 01:09 YBPN

i still run into the same collapse of the folder . so i just combine dired_floder/dired_expand and dired_refresh this two command , it work fine for me. here is the example:

{
        "keys": ["h"], 
        "command": "chain", 
        "args":
        {
            "commands":[
            ["dired_fold",], 
            ["dired_refresh",], 
        ], 
        }, 
        "context": [
            { "key": "selector", "operator": "equal", "operand": "text.dired" },
            { "key": "setting.dired_rename_mode", "operand": false } 
        ], 
    },

and use this chian command need install chain of command in (st2 or st3), as of st4 you can use that directly.

hathawayANdRX105 avatar Feb 12 '22 07:02 hathawayANdRX105