SublimeFileBrowser icon indicating copy to clipboard operation
SublimeFileBrowser copied to clipboard

Single click for opening files & directories

Open stelonix opened this issue 9 years ago • 9 comments

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

stelonix avatar May 04 '16 19:05 stelonix

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.

vovkkk avatar May 05 '16 01:05 vovkkk

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

aramk avatar May 31 '16 00:05 aramk

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

vovkkk avatar May 31 '16 02:05 vovkkk

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

aramk avatar May 31 '16 04:05 aramk

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

vovkkk avatar May 31 '16 05:05 vovkkk

@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"
    ]
}

aramk avatar May 31 '16 08:05 aramk

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.

vovkkk avatar May 31 '16 09:05 vovkkk

Thanks that fixes the double click

aramk avatar May 31 '16 23:05 aramk

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.

sahilrajput03 avatar Nov 05 '20 07:11 sahilrajput03