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

Single click for opening files & directories #114

Open stelonix opened 8 years ago

stelonix commented 8 years ago

Is it possible to require only a single click in order to open files & expand directories?

vovkkk commented 8 years ago

Should be possible theoretically.

You have to create your own command with unique name which will handle click (like our doubleclick) and bind this new command to click in sublime-mousemap file (like Default.sublime-mousemap). Keep both files in Packages/User folder.

Now the trick is that you should call 'drag_select' first, so it will change position of cursor, and then call appropriate command of SFB.

aramk commented 8 years ago

I can't get double click to work - is it enabled by default?

vovkkk commented 8 years ago

Yes, double click is enabled, perhaps you have to restart Sublime Text. Also, if it doesn’t work after restart, look at console, is there any error? View → Show Console

aramk commented 8 years ago

Hi @vovkkk, no errors. I'm running 3114 after restarting.

vovkkk commented 8 years ago

What exactly happen when you double click? OS? Any other plugins change mouse interactions? show me content of Preferences → Package Settings → Package Control → Settings — User

aramk commented 8 years ago

@vovkkk I'm using Mac OS X. Nothing happens on double click.

{
    "bootstrapped": true,
    "in_process_packages":
    [
    ],
    "installed_packages":
    [
        "AngularJS",
        "Babel",
        "Better CoffeeScript",
        "BetterFindBuffer",
        "ColorPicker",
        "Diffy",
        "DocBlockr",
        "FileBrowser",
        "Git",
        "GitGutter",
        "GotoWindow",
        "Gradle_Language",
        "Gutter Color",
        "Jade",
        "JavaScript Refactor",
        "JsFormat",
        "LESS",
        "LineEndings",
        "Material Theme - White Panels",
        "Maybs Quit",
        "Oceanic Next Color Scheme",
        "One Dark Color Scheme",
        "Origami",
        "Package Control",
        "Predawn",
        "Pretty JSON",
        "Pretty YAML",
        "Sass",
        "SideBarEnhancements",
        "Solarized Color Scheme",
        "SublimeLinter",
        "SublimeLinter-annotations",
        "SublimeLinter-coffee",
        "SublimeLinter-coffeelint",
        "SublimeLinter-contrib-ruby-lint",
        "SublimeLinter-contrib-sass-lint",
        "SublimeLinter-csslint",
        "SublimeLinter-html-tidy",
        "SublimeLinter-jscs",
        "SublimeLinter-json",
        "SublimeLinter-pyyaml",
        "SublimeXiki",
        "Terminal",
        "tern_for_sublime",
        "Theme - Centurion",
        "Theme - Spacegray",
        "TodoReview",
        "Tomorrow Color Schemes",
        "WordHighlight",
        "Wrap Plus",
        "Zen Tabs"
    ]
}
vovkkk commented 8 years ago

You have two plugins, mouse-maps of which are conflicting with SFB: WordHighlight, and SublimeXiki.

You may add them to ignored packages and see if dblclk works, to be sure if I’m right or not: Preferences → Settings — User:

{
    "ignored_packages":
    [
        "WordHighlight",
        "SublimeXiki",
        "Vintage"
    ]
}

The easiest fix is dropping SFB mouse-map to your Packages/User directory.

aramk commented 8 years ago

Thanks that fixes the double click

sahilrajput03 commented 3 years ago

Make a little extesion like -

# Path to save this file => Packages/User/NoPreview.py
import sublime
import sublime_plugin
import os

class NoPreview(sublime_plugin.EventListener):
    def on_load(self, view):
        if (os.path.exists(view.file_name())):
            view.run_command('save')

and name this file as NoPreview.py and save it to Packages/User/ directory.

It works good for me to open files with single click, I'm using windows 8.1.