aziz / SublimeFileBrowser

Ditch sidebar and browse your files in a normal tab with keyboard, like a pro!
MIT License
395 stars 45 forks source link

Sublime Text 4 folder collapsing bug #158

Open bbassett opened 3 years ago

bbassett commented 3 years ago

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 commented 3 years ago

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):
Ontopic commented 3 years ago

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...

YBPN commented 2 years ago

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 commented 2 years ago

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.

abdulrahman004 commented 2 years ago

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 ?

YBPN commented 2 years ago

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

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

hathawayANdRX105 commented 2 years ago

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.