From e2114ef50a28efeb8cb5bd266e0f6bf0e40c93c2 Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Fri, 24 Mar 2017 21:41:03 +0100 Subject: [PATCH 01/17] Remove paths args --- Side Bar.sublime-menu | 15 ----------- SideBar.py | 59 +++++++++++++++---------------------------- 2 files changed, 20 insertions(+), 54 deletions(-) diff --git a/Side Bar.sublime-menu b/Side Bar.sublime-menu index f800ed848..b5abda7c2 100644 --- a/Side Bar.sublime-menu +++ b/Side Bar.sublime-menu @@ -3,40 +3,25 @@ "caption": "Copy Filename", "id": "side-bar-clip-copy-name", "command": "side_bar_copy_name", - "args": { - "paths": [] - } }, { "caption": "Copy Path", "id": "side-bar-clip-copy-path", "command": "side_bar_copy_path_relative_from_project", - "args": { - "paths": [] - } }, { "caption": "Copy Absolute Path", "id": "side-bar-clip-copy-dir-path", "command": "side_bar_copy_dir_path", - "args": { - "paths": [] - } }, { "caption": "Duplicate…", "id": "side-bar-duplicate", "command": "side_bar_duplicate", - "args": { - "paths": [] - } }, { "caption": "Open With Default", "id": "side-bar-open", "command": "side_bar_open", - "args": { - "paths": [] - } } ] diff --git a/SideBar.py b/SideBar.py index 923287c0d..2837ed77a 100644 --- a/SideBar.py +++ b/SideBar.py @@ -11,11 +11,11 @@ s = {} Cache = {} -def CACHED_SELECTION(paths = []): +def CACHED_SELECTION(): if Cache.cached: return Cache.cached else: - return SideBarSelection(paths) + return SideBarSelection() def Window(window = None): return window if window else sublime.active_window() @@ -31,9 +31,9 @@ class Cache(): Cache.cached = False class SideBarCopyNameCommand(sublime_plugin.WindowCommand): - def run(self, paths = []): + def run(self): items = [] - for item in SideBarSelection(paths).getSelectedItems(): + for item in SideBarSelection().getSelectedItems(): items.append(item.name()) if len(items) > 0: @@ -43,16 +43,10 @@ def run(self, paths = []): else : sublime.status_message("Item copied") - def is_enabled(self, paths = []): - return CACHED_SELECTION(paths).len() > 0 - - def is_visible(self, paths =[]): - return not s.get('disabled_menuitem_copy_name', False) - class SideBarCopyPathCommand(sublime_plugin.WindowCommand): - def run(self, paths = []): + def run(self): items = [] - for item in SideBarSelection(paths).getSelectedItems(): + for item in SideBarSelection().getSelectedItems(): items.append(item.path()) if len(items) > 0: @@ -62,13 +56,12 @@ def run(self, paths = []): else : sublime.status_message("Item copied") - def is_enabled(self, paths = []): - return CACHED_SELECTION(paths).len() > 0 + class SideBarCopyDirPathCommand(sublime_plugin.WindowCommand): - def run(self, paths = []): + def run(self): items = [] - for item in SideBarSelection(paths).getSelectedDirectoriesOrDirnames(): + for item in SideBarSelection().getSelectedDirectoriesOrDirnames(): items.append(item.path()) if len(items) > 0: @@ -78,16 +71,15 @@ def run(self, paths = []): else : sublime.status_message("Item copied") - def is_enabled(self, paths = []): - return CACHED_SELECTION(paths).len() > 0 - def is_visible(self, paths =[]): + + def is_visible(self): return not s.get('disabled_menuitem_copy_dir_path', False) class SideBarCopyPathRelativeFromProjectCommand(sublime_plugin.WindowCommand): - def run(self, paths = []): + def run(self): items = [] - for item in SideBarSelection(paths).getSelectedItems(): + for item in SideBarSelection().getSelectedItems(): items.append(item.pathRelativeFromProject()) if len(items) > 0: @@ -97,13 +89,10 @@ def run(self, paths = []): else : sublime.status_message("Item copied") - def is_enabled(self, paths = []): - return CACHED_SELECTION(paths).len() > 0 and CACHED_SELECTION(paths).hasItemsUnderProject() - class SideBarCopyPathAbsoluteFromProjectCommand(sublime_plugin.WindowCommand): - def run(self, paths = []): + def run(self): items = [] - for item in SideBarSelection(paths).getSelectedItems(): + for item in SideBarSelection().getSelectedItems(): items.append(item.pathAbsoluteFromProject()) if len(items) > 0: @@ -113,24 +102,18 @@ def run(self, paths = []): else : sublime.status_message("Item copied") - def is_enabled(self, paths = []): - return CACHED_SELECTION(paths).len() > 0 and CACHED_SELECTION(paths).hasItemsUnderProject() - class SideBarDuplicateCommand(sublime_plugin.WindowCommand): - def run(self, paths = [], new = False): + def run(self, new = False): import functools Window().run_command('hide_panel'); - view = Window().show_input_panel("Duplicate As:", new or SideBarSelection(paths).getSelectedItems()[0].path(), functools.partial(self.on_done, SideBarSelection(paths).getSelectedItems()[0].path()), None, None) + view = Window().show_input_panel("Duplicate As:", new or SideBarSelection().getSelectedItems()[0].path(), functools.partial(self.on_done, SideBarSelection().getSelectedItems()[0].path()), None, None) view.sel().clear() - view.sel().add(sublime.Region(view.size()-len(SideBarSelection(paths).getSelectedItems()[0].name()), view.size()-len(SideBarSelection(paths).getSelectedItems()[0].extension()))) + view.sel().add(sublime.Region(view.size()-len(SideBarSelection().getSelectedItems()[0].name()), view.size()-len(SideBarSelection().getSelectedItems()[0].extension()))) def on_done(self, old, new): key = 'duplicate-'+str(time.time()) SideBarDuplicateThread(old, new, key).start() - def is_enabled(self, paths = []): - return CACHED_SELECTION(paths).len() == 1 and CACHED_SELECTION(paths).hasProjectDirectories() == False - class SideBarDuplicateThread(threading.Thread): def __init__(self, old, new, key): self.old = old @@ -159,12 +142,10 @@ def run(self): SideBarDuplicateCommand(Window()).run([old], new) return item = SideBarItem(new, os.path.isdir(new)) - if item.isFile(): - item.edit(); SideBarProject().refresh(); window_set_status(key, '') class SideBarOpenCommand(sublime_plugin.WindowCommand): - def run(self, paths = []): - for item in SideBarSelection(paths).getSelectedItems(): + def run(self): + for item in SideBarSelection().getSelectedItems(): item.open() From 4fa9696ae9ec3fb436e3d82143d3e3e3745c2690 Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Fri, 24 Mar 2017 21:49:39 +0100 Subject: [PATCH 02/17] Simplify SideBarCopyNameCommand --- SideBar.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/SideBar.py b/SideBar.py index 2837ed77a..68184cdaa 100644 --- a/SideBar.py +++ b/SideBar.py @@ -32,16 +32,9 @@ class Cache(): class SideBarCopyNameCommand(sublime_plugin.WindowCommand): def run(self): - items = [] - for item in SideBarSelection().getSelectedItems(): - items.append(item.name()) - - if len(items) > 0: - sublime.set_clipboard("\n".join(items)); - if len(items) > 1 : - sublime.status_message("Items copied") - else : - sublime.status_message("Item copied") + filename = self.window.active_view().file_name() + sublime.set_clipboard(filename) + sublime.status_message('copied "{}" to clipboard'.format(filename)) class SideBarCopyPathCommand(sublime_plugin.WindowCommand): def run(self): From 99eda7c7a5f4b66668c2e91adfac8e084261425b Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Fri, 24 Mar 2017 21:51:29 +0100 Subject: [PATCH 03/17] Fix SideBarCopyNameCommand --- SideBar.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SideBar.py b/SideBar.py index 68184cdaa..2fe0b4f95 100644 --- a/SideBar.py +++ b/SideBar.py @@ -32,9 +32,9 @@ class Cache(): class SideBarCopyNameCommand(sublime_plugin.WindowCommand): def run(self): - filename = self.window.active_view().file_name() - sublime.set_clipboard(filename) - sublime.status_message('copied "{}" to clipboard'.format(filename)) + name = os.path.split(self.window.active_view().file_name())[1] + sublime.set_clipboard(name) + sublime.status_message('copied "{}" to clipboard'.format(name)) class SideBarCopyPathCommand(sublime_plugin.WindowCommand): def run(self): From d19b12b2d18d24228ef856735ebd32404e53b089 Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Fri, 24 Mar 2017 22:18:41 +0100 Subject: [PATCH 04/17] Rename commands --- Commands.sublime-commands | 6 +++--- Side Bar.sublime-menu | 27 ++++++++++++++++----------- SideBar.py | 20 ++++++++------------ 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/Commands.sublime-commands b/Commands.sublime-commands index c7b6a90b7..07cb281cf 100644 --- a/Commands.sublime-commands +++ b/Commands.sublime-commands @@ -8,12 +8,12 @@ "command": "side_bar_copy_name" }, { - "caption": "File: Copy Path", - "command": "side_bar_copy_path_relative_from_project" + "caption": "File: Copy Relative Path", + "command": "side_bar_copy_relative_path" }, { "caption": "File: Copy Absolute Path", - "command": "side_bar_copy_dir_path" + "command": "side_bar_copy_absolute_path" }, { "caption": "File: Duplicate", diff --git a/Side Bar.sublime-menu b/Side Bar.sublime-menu index b5abda7c2..093119ab7 100644 --- a/Side Bar.sublime-menu +++ b/Side Bar.sublime-menu @@ -1,27 +1,32 @@ [ + { + "caption": "Reveal in Sidebar", + "id": "SideBarTools", + "command": "reveal_in_side_bar" + }, { "caption": "Copy Filename", - "id": "side-bar-clip-copy-name", - "command": "side_bar_copy_name", + "id": "SideBarTools", + "command": "side_bar_copy_name" }, { - "caption": "Copy Path", - "id": "side-bar-clip-copy-path", - "command": "side_bar_copy_path_relative_from_project", + "caption": "Copy Relative Path", + "id": "SideBarTools", + "command": "side_bar_copy_relative_path" }, { "caption": "Copy Absolute Path", - "id": "side-bar-clip-copy-dir-path", - "command": "side_bar_copy_dir_path", + "id": "SideBarTools", + "command": "side_bar_copy_absolute_path" }, { - "caption": "Duplicate…", - "id": "side-bar-duplicate", - "command": "side_bar_duplicate", + "caption": "Duplicate", + "id": "SideBarTools", + "command": "side_bar_duplicate" }, { "caption": "Open With Default", - "id": "side-bar-open", + "id": "SideBarTools", "command": "side_bar_open", } ] diff --git a/SideBar.py b/SideBar.py index 2fe0b4f95..91db00b4b 100644 --- a/SideBar.py +++ b/SideBar.py @@ -36,20 +36,16 @@ def run(self): sublime.set_clipboard(name) sublime.status_message('copied "{}" to clipboard'.format(name)) -class SideBarCopyPathCommand(sublime_plugin.WindowCommand): +class SideBarCopyAbsolutePathCommand(sublime_plugin.WindowCommand): def run(self): - items = [] - for item in SideBarSelection().getSelectedItems(): - items.append(item.path()) - - if len(items) > 0: - sublime.set_clipboard("\n".join(items)); - if len(items) > 1 : - sublime.status_message("Items copied") - else : - sublime.status_message("Item copied") - + path = self.window.active_view().file_name() + sublime.set_clipboard(path) + sublime.status_message('copied "{}" to clipboard'.format(path)) +class SideBarCopyRelativePathCommand(sublime_plugin.WindowCommand): + def run(self): + path = self.window.active_view().file_name() + self.window.project_data() class SideBarCopyDirPathCommand(sublime_plugin.WindowCommand): def run(self): From fe71b20708393ddc849aa759678668d67d009f42 Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Fri, 24 Mar 2017 22:35:18 +0100 Subject: [PATCH 05/17] Simplify relative and absolute path copying --- SideBar.py | 50 +++++++++++++++++++------------------------------- 1 file changed, 19 insertions(+), 31 deletions(-) diff --git a/SideBar.py b/SideBar.py index 91db00b4b..b4952ee3c 100644 --- a/SideBar.py +++ b/SideBar.py @@ -30,22 +30,36 @@ class Cache(): Cache = Cache() Cache.cached = False +def copy_to_clipboard_and_inform(data): + sublime.set_clipboard(data) + sublime.status_message('copied "{}" to clipboard'.format(data)) + class SideBarCopyNameCommand(sublime_plugin.WindowCommand): def run(self): name = os.path.split(self.window.active_view().file_name())[1] - sublime.set_clipboard(name) - sublime.status_message('copied "{}" to clipboard'.format(name)) + copy_to_clipboard_and_inform(name) class SideBarCopyAbsolutePathCommand(sublime_plugin.WindowCommand): def run(self): path = self.window.active_view().file_name() - sublime.set_clipboard(path) - sublime.status_message('copied "{}" to clipboard'.format(path)) + copy_to_clipboard_and_inform(path) class SideBarCopyRelativePathCommand(sublime_plugin.WindowCommand): def run(self): path = self.window.active_view().file_name() - self.window.project_data() + project_file_name = self.window.project_file_name() + root_dir = '' + if project_file_name: + root_dir = os.path.dirname(project_file_name) + else: + root_dir = self.window.project_data()['folders'][0]['path'] + # I would like to use os.path.commonpath, but that is only available + # since Python 3.5. We are on Python 3.3. + common = os.path.commonprefix([root_dir, path]) + path = path[len(common):] + if path.startswith('/') or path.startswith('\\'): + path = path[1:] + copy_to_clipboard_and_inform(path) class SideBarCopyDirPathCommand(sublime_plugin.WindowCommand): def run(self): @@ -65,32 +79,6 @@ def run(self): def is_visible(self): return not s.get('disabled_menuitem_copy_dir_path', False) -class SideBarCopyPathRelativeFromProjectCommand(sublime_plugin.WindowCommand): - def run(self): - items = [] - for item in SideBarSelection().getSelectedItems(): - items.append(item.pathRelativeFromProject()) - - if len(items) > 0: - sublime.set_clipboard("\n".join(items)); - if len(items) > 1 : - sublime.status_message("Items copied") - else : - sublime.status_message("Item copied") - -class SideBarCopyPathAbsoluteFromProjectCommand(sublime_plugin.WindowCommand): - def run(self): - items = [] - for item in SideBarSelection().getSelectedItems(): - items.append(item.pathAbsoluteFromProject()) - - if len(items) > 0: - sublime.set_clipboard("\n".join(items)); - if len(items) > 1 : - sublime.status_message("Items copied") - else : - sublime.status_message("Item copied") - class SideBarDuplicateCommand(sublime_plugin.WindowCommand): def run(self, new = False): import functools From 3199802c33e59a6e22c6a590f27b0b21cfbe70a2 Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Fri, 24 Mar 2017 22:41:29 +0100 Subject: [PATCH 06/17] Enable and simplify SideBarCopyDirPathCommand --- Side Bar.sublime-menu | 5 +++++ SideBar.py | 17 ++--------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/Side Bar.sublime-menu b/Side Bar.sublime-menu index 093119ab7..72eb52a06 100644 --- a/Side Bar.sublime-menu +++ b/Side Bar.sublime-menu @@ -19,6 +19,11 @@ "id": "SideBarTools", "command": "side_bar_copy_absolute_path" }, + { + "caption": "Copy Directory Path", + "id": "SideBarTools", + "command": "side_bar_copy_dir_path" + }, { "caption": "Duplicate", "id": "SideBarTools", diff --git a/SideBar.py b/SideBar.py index b4952ee3c..7628bb756 100644 --- a/SideBar.py +++ b/SideBar.py @@ -63,21 +63,8 @@ def run(self): class SideBarCopyDirPathCommand(sublime_plugin.WindowCommand): def run(self): - items = [] - for item in SideBarSelection().getSelectedDirectoriesOrDirnames(): - items.append(item.path()) - - if len(items) > 0: - sublime.set_clipboard("\n".join(items)); - if len(items) > 1 : - sublime.status_message("Items copied") - else : - sublime.status_message("Item copied") - - - - def is_visible(self): - return not s.get('disabled_menuitem_copy_dir_path', False) + path = self.window.active_view().file_name() + copy_to_clipboard_and_inform(os.path.dirname(path)) class SideBarDuplicateCommand(sublime_plugin.WindowCommand): def run(self, new = False): From abf15bb219494e9cc468de8e488e283bd8581378 Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Fri, 24 Mar 2017 23:13:19 +0100 Subject: [PATCH 07/17] Simplify duplicate command --- Side Bar.sublime-menu | 2 +- SideBar.py | 65 ++++++++++++++++--------------------------- 2 files changed, 25 insertions(+), 42 deletions(-) diff --git a/Side Bar.sublime-menu b/Side Bar.sublime-menu index 72eb52a06..2407f4fb2 100644 --- a/Side Bar.sublime-menu +++ b/Side Bar.sublime-menu @@ -25,7 +25,7 @@ "command": "side_bar_copy_dir_path" }, { - "caption": "Duplicate", + "caption": "Duplicate…", "id": "SideBarTools", "command": "side_bar_duplicate" }, diff --git a/SideBar.py b/SideBar.py index 7628bb756..0433e4602 100644 --- a/SideBar.py +++ b/SideBar.py @@ -1,9 +1,11 @@ # coding=utf8 -import sublime, sublime_plugin - +import sublime +import sublime_plugin import os import threading import time +import shutil +import functools from .SideBarAPI import SideBarItem, SideBarSelection, SideBarProject @@ -67,47 +69,28 @@ def run(self): copy_to_clipboard_and_inform(os.path.dirname(path)) class SideBarDuplicateCommand(sublime_plugin.WindowCommand): - def run(self, new = False): - import functools - Window().run_command('hide_panel'); - view = Window().show_input_panel("Duplicate As:", new or SideBarSelection().getSelectedItems()[0].path(), functools.partial(self.on_done, SideBarSelection().getSelectedItems()[0].path()), None, None) - view.sel().clear() - view.sel().add(sublime.Region(view.size()-len(SideBarSelection().getSelectedItems()[0].name()), view.size()-len(SideBarSelection().getSelectedItems()[0].extension()))) - - def on_done(self, old, new): - key = 'duplicate-'+str(time.time()) - SideBarDuplicateThread(old, new, key).start() - -class SideBarDuplicateThread(threading.Thread): - def __init__(self, old, new, key): - self.old = old - self.new = new - self.key = key - threading.Thread.__init__(self) def run(self): - old = self.old - new = self.new - key = self.key - window_set_status(key, 'Duplicating…') - - item = SideBarItem(old, os.path.isdir(old)) - try: - if not item.copy(new): - window_set_status(key, '') - if SideBarItem(new, os.path.isdir(new)).overwrite(): - self.run() - else: - SideBarDuplicateCommand(Window()).run([old], new) - return - except: - window_set_status(key, '') - sublime.error_message("Unable to copy:\n\n"+old+"\n\nto\n\n"+new) - SideBarDuplicateCommand(Window()).run([old], new) - return - item = SideBarItem(new, os.path.isdir(new)) - SideBarProject().refresh(); - window_set_status(key, '') + self.view = self.window.active_view() + self.source = self.view.file_name() + base, leaf = os.path.split(self.source) + name, ext = os.path.splitext(leaf) + initial_text = name + ' (Copy)' + ext + self.window.show_input_panel('Duplicate As:', + initial_text, self.on_done, None, None) + + def on_done(self, destination): + base, _ = os.path.split(self.source) + destination = os.path.join(base, destination) + threading.Thread(target=self.copy, + args=(self.source, destination)).start() + + def copy(self, source, destination): + print(source, destination) + self.view.set_status('ZZZ', 'copying "{}" to "{}"'.format( + source, destination)) + shutil.copy2(source, destination) + self.view.erase_status('ZZZ') class SideBarOpenCommand(sublime_plugin.WindowCommand): def run(self): From 6bf336fdc6374ca169071687d039fd8dc12a6587 Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Fri, 24 Mar 2017 23:49:56 +0100 Subject: [PATCH 08/17] Simplify open command --- Side Bar.sublime-menu | 2 +- SideBar.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Side Bar.sublime-menu b/Side Bar.sublime-menu index 2407f4fb2..5e14627d8 100644 --- a/Side Bar.sublime-menu +++ b/Side Bar.sublime-menu @@ -30,7 +30,7 @@ "command": "side_bar_duplicate" }, { - "caption": "Open With Default", + "caption": "Open With Default…", "id": "SideBarTools", "command": "side_bar_open", } diff --git a/SideBar.py b/SideBar.py index 0433e4602..c279d31d7 100644 --- a/SideBar.py +++ b/SideBar.py @@ -93,6 +93,8 @@ def copy(self, source, destination): self.view.erase_status('ZZZ') class SideBarOpenCommand(sublime_plugin.WindowCommand): + def run(self): - for item in SideBarSelection().getSelectedItems(): - item.open() + path = self.window.active_view().file_name() + print(path) + self.window.run_command('open_url', args={'url': path}) From b9fb3e56f7f4e2c56e6e2fbbde1a4a0509440451 Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Sat, 25 Mar 2017 16:17:32 +0100 Subject: [PATCH 09/17] Simplify all commands --- Commands.sublime-commands | 15 ++++++--- Side Bar.sublime-menu | 29 ++++++++-------- SideBar.py | 69 +++++++++++++++++++++------------------ 3 files changed, 64 insertions(+), 49 deletions(-) diff --git a/Commands.sublime-commands b/Commands.sublime-commands index 07cb281cf..f52adcefb 100644 --- a/Commands.sublime-commands +++ b/Commands.sublime-commands @@ -1,22 +1,27 @@ [ { "caption": "File: Reveal in Sidebar", - "command": "reveal_in_side_bar" + "command": "reveal_in_side_bar", + "args": { "paths": [] } }, { "caption": "File: Copy Filename", - "command": "side_bar_copy_name" + "command": "side_bar_copy_name", + "args": { "paths": [] } }, { "caption": "File: Copy Relative Path", - "command": "side_bar_copy_relative_path" + "command": "side_bar_copy_relative_path", + "args": { "paths": [] } }, { "caption": "File: Copy Absolute Path", - "command": "side_bar_copy_absolute_path" + "command": "side_bar_copy_absolute_path", + "args": { "paths": [] } }, { "caption": "File: Duplicate", - "command": "side_bar_duplicate" + "command": "side_bar_duplicate", + "args": { "paths": [] } } ] diff --git a/Side Bar.sublime-menu b/Side Bar.sublime-menu index 5e14627d8..1398b9e9f 100644 --- a/Side Bar.sublime-menu +++ b/Side Bar.sublime-menu @@ -1,37 +1,40 @@ [ + { + "id": "SideBarTools", "caption": "-" + }, { "caption": "Reveal in Sidebar", - "id": "SideBarTools", - "command": "reveal_in_side_bar" + "command": "reveal_in_side_bar", + "args": { "paths": [] } }, { "caption": "Copy Filename", - "id": "SideBarTools", - "command": "side_bar_copy_name" + "command": "side_bar_copy_name", + "args": { "paths": [] } }, { "caption": "Copy Relative Path", - "id": "SideBarTools", - "command": "side_bar_copy_relative_path" + "command": "side_bar_copy_relative_path", + "args": { "paths": [] } }, { "caption": "Copy Absolute Path", - "id": "SideBarTools", - "command": "side_bar_copy_absolute_path" + "command": "side_bar_copy_absolute_path", + "args": { "paths": [] } }, { "caption": "Copy Directory Path", - "id": "SideBarTools", - "command": "side_bar_copy_dir_path" + "command": "side_bar_copy_dir_path", + "args": { "paths": [] } }, { "caption": "Duplicate…", - "id": "SideBarTools", - "command": "side_bar_duplicate" + "command": "side_bar_duplicate", + "args": { "paths": [] } }, { "caption": "Open With Default…", - "id": "SideBarTools", "command": "side_bar_open", + "args": { "paths": [] } } ] diff --git a/SideBar.py b/SideBar.py index c279d31d7..6f5202a34 100644 --- a/SideBar.py +++ b/SideBar.py @@ -32,23 +32,25 @@ class Cache(): Cache = Cache() Cache.cached = False -def copy_to_clipboard_and_inform(data): - sublime.set_clipboard(data) - sublime.status_message('copied "{}" to clipboard'.format(data)) - -class SideBarCopyNameCommand(sublime_plugin.WindowCommand): - def run(self): - name = os.path.split(self.window.active_view().file_name())[1] - copy_to_clipboard_and_inform(name) - -class SideBarCopyAbsolutePathCommand(sublime_plugin.WindowCommand): - def run(self): - path = self.window.active_view().file_name() - copy_to_clipboard_and_inform(path) - -class SideBarCopyRelativePathCommand(sublime_plugin.WindowCommand): - def run(self): - path = self.window.active_view().file_name() +class SideBarCommand(sublime_plugin.WindowCommand): + def copy_to_clipboard_and_inform(self, data): + sublime.set_clipboard(data) + self.window.status_message('copied "{}" to clipboard'.format(data)) + +class SideBarCopyNameCommand(SideBarCommand): + def run(self, paths): + path = paths[0] + name = os.path.split(path)[1] + self.copy_to_clipboard_and_inform(name) + +class SideBarCopyAbsolutePathCommand(SideBarCommand): + def run(self, paths): + path = paths[0] + self.copy_to_clipboard_and_inform(path) + +class SideBarCopyRelativePathCommand(SideBarCommand): + def run(self, paths): + path = paths[0] project_file_name = self.window.project_file_name() root_dir = '' if project_file_name: @@ -61,18 +63,18 @@ def run(self): path = path[len(common):] if path.startswith('/') or path.startswith('\\'): path = path[1:] - copy_to_clipboard_and_inform(path) + self.copy_to_clipboard_and_inform(path) -class SideBarCopyDirPathCommand(sublime_plugin.WindowCommand): - def run(self): - path = self.window.active_view().file_name() - copy_to_clipboard_and_inform(os.path.dirname(path)) +class SideBarCopyDirPathCommand(SideBarCommand): + def run(self, paths): + path = paths[0] + self.copy_to_clipboard_and_inform(os.path.dirname(path)) -class SideBarDuplicateCommand(sublime_plugin.WindowCommand): +class SideBarDuplicateCommand(SideBarCommand): - def run(self): + def run(self, paths): self.view = self.window.active_view() - self.source = self.view.file_name() + self.source = paths[0] base, leaf = os.path.split(self.source) name, ext = os.path.splitext(leaf) initial_text = name + ' (Copy)' + ext @@ -87,14 +89,19 @@ def on_done(self, destination): def copy(self, source, destination): print(source, destination) - self.view.set_status('ZZZ', 'copying "{}" to "{}"'.format( - source, destination)) + if self.view: + self.view.set_status('ZZZ', 'copying "{}" to "{}"'.format( + source, destination)) + else: + self.window.status_message('copying "{}" to "{}"'.format( + source, destination)) shutil.copy2(source, destination) - self.view.erase_status('ZZZ') + if self.view: + self.view.erase_status('ZZZ') -class SideBarOpenCommand(sublime_plugin.WindowCommand): +class SideBarOpenCommand(SideBarCommand): - def run(self): - path = self.window.active_view().file_name() + def run(self, paths): + path = paths[0] print(path) self.window.run_command('open_url', args={'url': path}) From b475fb64bb09819ae90ddbb369451ba9728fe223 Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Sat, 25 Mar 2017 16:18:07 +0100 Subject: [PATCH 10/17] Remove SideBarAPI.py file --- SideBarAPI.py | 443 -------------------------------------------------- 1 file changed, 443 deletions(-) delete mode 100644 SideBarAPI.py diff --git a/SideBarAPI.py b/SideBarAPI.py deleted file mode 100644 index aefef7d5b..000000000 --- a/SideBarAPI.py +++ /dev/null @@ -1,443 +0,0 @@ -# coding=utf8 -import sublime -import os -import re -import shutil - -class Object(): - pass - -class SideBarSelection: - - def __init__(self, paths = []): - - if not paths or len(paths) < 1: - try: - path = sublime.active_window().active_view().file_name() - if self.isNone(path): - paths = [] - else: - paths = [path] - except: - paths = [] - self._paths = paths - self._paths.sort() - self._obtained_selection_information_basic = False - self._obtained_selection_information_extended = False - - def len(self): - return len(self._paths) - - def hasDirectories(self): - self._obtainSelectionInformationBasic() - return self._has_directories - - def hasFiles(self): - self._obtainSelectionInformationBasic() - return self._has_files - - def hasOnlyDirectories(self): - self._obtainSelectionInformationBasic() - return self._only_directories - - def hasOnlyFiles(self): - self._obtainSelectionInformationBasic() - return self._only_files - - def hasProjectDirectories(self): - if self.hasDirectories(): - project_directories = SideBarProject().getDirectories() - for item in self.getSelectedDirectories(): - if item.path() in project_directories: - return True - return False - else: - return False - - def hasItemsUnderProject(self): - for item in self.getSelectedItems(): - if item.isUnderCurrentProject(): - return True - return False - - def hasImages(self): - return self.hasFilesWithExtension('gif|jpg|jpeg|png') - - def hasFilesWithExtension(self, extensions): - extensions = re.compile('('+extensions+')$', re.I); - for item in self.getSelectedFiles(): - if extensions.search(item.path()): - return True; - return False - - def getSelectedItems(self): - self._obtainSelectionInformationExtended() - return self._files + self._directories; - - def getSelectedItemsWithoutChildItems(self): - self._obtainSelectionInformationExtended() - items = [] - for item in self._items_without_containing_child_items: - items.append(SideBarItem(item, os.path.isdir(item))) - return items - - def getSelectedDirectories(self): - self._obtainSelectionInformationExtended() - return self._directories; - - def getSelectedFiles(self): - self._obtainSelectionInformationExtended() - return self._files; - - def getSelectedDirectoriesOrDirnames(self): - self._obtainSelectionInformationExtended() - return self._directories_or_dirnames; - - def getSelectedImages(self): - return self.getSelectedFilesWithExtension('gif|jpg|jpeg|png') - - def getSelectedFilesWithExtension(self, extensions): - items = [] - extensions = re.compile('('+extensions+')$', re.I); - for item in self.getSelectedFiles(): - if extensions.search(item.path()): - items.append(item) - return items - - def _obtainSelectionInformationBasic(self): - if not self._obtained_selection_information_basic: - self._obtained_selection_information_basic = True - - self._has_directories = False - self._has_files = False - self._only_directories = False - self._only_files = False - - for path in self._paths: - if self._has_directories == False and os.path.isdir(path): - self._has_directories = True - if self._has_files == False and os.path.isdir(path) == False: - self._has_files = True - if self._has_files and self._has_directories: - break - - if self._has_files and self._has_directories: - self._only_directories = False - self._only_files = False - elif self._has_files: - self._only_files = True - elif self._has_directories: - self._only_directories = True - - def _obtainSelectionInformationExtended(self): - if not self._obtained_selection_information_extended: - self._obtained_selection_information_extended = True - - self._directories = [] - self._files = [] - self._directories_or_dirnames = [] - self._items_without_containing_child_items = [] - - _directories = [] - _files = [] - _directories_or_dirnames = [] - _items_without_containing_child_items = [] - - for path in self._paths: - if os.path.isdir(path): - item = SideBarItem(path, True) - if item.path() not in _directories: - _directories.append(item.path()) - self._directories.append(item) - if item.path() not in _directories_or_dirnames: - _directories_or_dirnames.append(item.path()) - self._directories_or_dirnames.append(item) - _items_without_containing_child_items = self._itemsWithoutContainingChildItems(_items_without_containing_child_items, item.path()) - else: - item = SideBarItem(path, False) - if item.path() not in _files: - _files.append(item.path()) - self._files.append(item) - _items_without_containing_child_items = self._itemsWithoutContainingChildItems(_items_without_containing_child_items, item.path()) - item = SideBarItem(os.path.dirname(path), True) - if item.path() not in _directories_or_dirnames: - _directories_or_dirnames.append(item.path()) - self._directories_or_dirnames.append(item) - - self._items_without_containing_child_items = _items_without_containing_child_items - - def _itemsWithoutContainingChildItems(self, items, item): - new_list = [] - add = True - for i in items: - if i.find(item+'\\') == 0 or i.find(item+'/') == 0: - continue - else: - new_list.append(i) - if (item+'\\').find(i+'\\') == 0 or (item+'/').find(i+'/') == 0: - add = False - if add: - new_list.append(item) - return new_list - - def isNone(self, path): - if path == None or path == '' or path == '.' or path == '..' or path == './' or path == '../' or path == '/' or path == '//' or path == '\\' or path == '\\\\' or path == '\\\\\\\\' or path == '\\\\?\\' or path == '\\\\?' or path == '\\\\\\\\?\\\\': - return True - else: - return False - -class SideBarProject: - - def getDirectories(self): - return sublime.active_window().folders() - - def hasDirectories(self): - return len(self.getDirectories()) > 0 - - def hasOpenedProject(self): - return self.getProjectFile() != None - - def getDirectoryFromPath(self, path): - for directory in self.getDirectories(): - maybe_path = path.replace(directory, '', 1) - if maybe_path != path: - return directory - - def getProjectFile(self): - return sublime.active_window().project_file_name() - - def getProjectJson(self): - return sublime.active_window().project_data() - - def setProjectJson(self, data): - return sublime.active_window().set_project_data(data) - - def excludeDirectory(self, path, exclude): - data = self.getProjectJson() - for folder in data['folders']: - project_folder = folder['path'] - if project_folder == '.': - project_folder = SideBarItem(self.getProjectFile(), False).dirname(); - if path.find(project_folder) == 0: - try: - folder['folder_exclude_patterns'].append(exclude) - except: - folder['folder_exclude_patterns'] = [exclude] - self.setProjectJson(data); - - def excludeFile(self, path, exclude): - data = self.getProjectJson() - for folder in data['folders']: - project_folder = folder['path'] - if project_folder == '.': - project_folder = SideBarItem(self.getProjectFile(), False).dirname(); - if path.find(project_folder) == 0: - try: - folder['file_exclude_patterns'].append(exclude) - except: - folder['file_exclude_patterns'] = [exclude] - self.setProjectJson(data); - - def add(self, path): - data = self.getProjectJson() - if data: - data['folders'].append({'follow_symlinks':True, 'path':path}); - else: - data = {'folders': [{'follow_symlinks': True, 'path':path}]} - self.setProjectJson(data); - - def refresh(self): - sublime.active_window().run_command('refresh_folder_list') - -class SideBarItem: - - def __init__(self, path, is_directory): - self._path = path - self._is_directory = is_directory - - def path(self, path = ''): - if path == '': - return self._path - else: - self._path = path - self._is_directory = os.path.isdir(path) - return path - - def pathWithoutProject(self): - path = self.path() - for directory in SideBarProject().getDirectories(): - path = path.replace(directory, '', 1) - return path.replace('\\', '/') - - def pathProject(self): - path = self.path() - for directory in SideBarProject().getDirectories(): - path2 = path.replace(directory, '', 1) - if path2 != path: - return directory - return False - - def isUnderCurrentProject(self): - path = self.path() - path2 = self.path() - for directory in SideBarProject().getDirectories(): - path2 = path2.replace(directory, '', 1) - return path != path2 - - def pathRelativeFromProject(self): - return re.sub('^/+', '', self.pathWithoutProject()) - - def pathRelativeFromProjectEncoded(self): - import urllib.request, urllib.parse, urllib.error - return urllib.parse.quote(self.pathRelativeFromProject()) - - def pathRelativeFromView(self): - return os.path.relpath(self.path(), os.path.dirname(sublime.active_window().active_view().file_name())).replace('\\', '/') - - def pathRelativeFromViewEncoded(self): - import urllib.request, urllib.parse, urllib.error - return urllib.parse.quote(os.path.relpath(self.path(), os.path.dirname(sublime.active_window().active_view().file_name())).replace('\\', '/')) - - def pathAbsoluteFromProject(self): - return self.pathWithoutProject() - - def pathAbsoluteFromProjectEncoded(self): - import urllib.request, urllib.parse, urllib.error - return urllib.parse.quote(self.pathAbsoluteFromProject()) - - def uri(self): - uri = 'file:'+(self.path().replace('\\', '/').replace('//', '/')); - return uri - - def join(self, name): - return os.path.join(self.path(), name) - - def dirname(self): - branch, leaf = os.path.split(self.path()) - return branch; - - def forCwdSystemPath(self): - if self.isDirectory(): - return self.path() - else: - return self.dirname() - - def forCwdSystemName(self): - if self.isDirectory(): - return '.' - else: - path = self.path() - branch = self.dirname() - leaf = path.replace(branch, '', 1).replace('\\', '').replace('/', '') - return leaf - - def forCwdSystemPathRelativeFrom(self, relativeFrom): - relative = SideBarItem(relativeFrom, os.path.isdir(relativeFrom)) - path = self.path().replace(relative.path(), '', 1).replace('\\', '/') - if path == '': - return '.' - else: - return re.sub('^/+', '', path) - - def forCwdSystemPathRelativeFromRecursive(self, relativeFrom): - relative = SideBarItem(relativeFrom, os.path.isdir(relativeFrom)) - path = self.path().replace(relative.path(), '', 1).replace('\\', '/') - if path == '': - return '.' - else: - if self.isDirectory(): - return re.sub('^/+', '', path)+'/' - else: - return re.sub('^/+', '', path) - - def dirnameCreate(self): - try: - self._makedirs(self.dirname()) - except: - pass - - def name(self): - branch, leaf = os.path.split(self.path()) - return leaf; - - def open(self): - if sublime.platform() == 'osx': - import subprocess - subprocess.Popen(['open', self.name()], cwd=self.dirname()) - elif sublime.platform() == 'windows': - import subprocess - subprocess.Popen(['start', '', escapeCMDWindows(self.path())], cwd=self.dirname(), shell=True) - else: - from . import desktop - desktop.open(self.path()) - print('using desktop') - - def isDirectory(self): - return self._is_directory - - def isFile(self): - return self.isDirectory() == False - - def extension(self): - try: - return re.compile('(\.[^\.]+(\.[^\.]{2,4})?)$').findall('name'+self.name())[0][0].lower() - except: - return os.path.splitext('name'+self.name())[1].lower() - - def exists(self): - return os.path.isdir(self.path()) or os.path.isfile(self.path()) - - def overwrite(self): - overwrite = sublime.message_dialog("Destination exists") - return False - - def _makedirs(self, path): - if 3000 <= int(sublime.version()) < 3088: - # Fixes as best as possible a new directory permissions issue - # See https://github.com/titoBouzout/SideBarEnhancements/issues/203 - # See https://github.com/SublimeTextIssues/Core/issues/239 - oldmask = os.umask(0o000) - if oldmask == 0: - os.makedirs(path, 0o755); - else: - os.makedirs(path); - os.umask(oldmask) - else: - os.makedirs(path) - - def copy(self, location, replace = False): - location = SideBarItem(location, os.path.isdir(location)); - if location.exists() and replace == False: - return False - elif location.exists() and location.isFile(): - os.remove(location.path()) - - location.dirnameCreate(); - if self.isDirectory(): - if location.exists(): - self.copyRecursive(self.path(), location.path()) - else: - shutil.copytree(self.path(), location.path()) - else: - shutil.copy2(self.path(), location.path()) - return True - - def copyRecursive(self, _from, _to): - - if os.path.isfile(_from) or os.path.islink(_from): - try: - self._makedirs(os.path.dirname(_to)); - except: - pass - if os.path.exists(_to): - os.remove(_to) - shutil.copy2(_from, _to) - else: - try: - self._makedirs(_to); - except: - pass - for content in os.listdir(_from): - __from = os.path.join(_from, content) - __to = os.path.join(_to, content) - self.copyRecursive(__from, __to) From 2879e6ff07fc46211142cc3a545c613dcddc00fc Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Sat, 25 Mar 2017 16:18:28 +0100 Subject: [PATCH 11/17] Clean up --- SideBar.py | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/SideBar.py b/SideBar.py index 6f5202a34..ae4a0dadb 100644 --- a/SideBar.py +++ b/SideBar.py @@ -7,31 +7,6 @@ import shutil import functools -from .SideBarAPI import SideBarItem, SideBarSelection, SideBarProject - -global s, Cache -s = {} -Cache = {} - -def CACHED_SELECTION(): - if Cache.cached: - return Cache.cached - else: - return SideBarSelection() - -def Window(window = None): - return window if window else sublime.active_window() - -def window_set_status(key, name =''): - for window in sublime.windows(): - for view in window.views(): - view.set_status('SideBar-'+key, name) - -class Cache(): - pass -Cache = Cache() -Cache.cached = False - class SideBarCommand(sublime_plugin.WindowCommand): def copy_to_clipboard_and_inform(self, data): sublime.set_clipboard(data) From d2483f87ed36344203d84c562f00bf3cc8627d91 Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Sat, 25 Mar 2017 16:31:12 +0100 Subject: [PATCH 12/17] Clean up part 2 --- SideBar.py | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/SideBar.py b/SideBar.py index ae4a0dadb..f2e1b9beb 100644 --- a/SideBar.py +++ b/SideBar.py @@ -8,24 +8,40 @@ import functools class SideBarCommand(sublime_plugin.WindowCommand): + def copy_to_clipboard_and_inform(self, data): sublime.set_clipboard(data) self.window.status_message('copied "{}" to clipboard'.format(data)) + def get_path(self, paths): + try: + return paths[0] + except IndexError: + return self.window.active_view().file_name() + class SideBarCopyNameCommand(SideBarCommand): + def run(self, paths): - path = paths[0] + path = self.get_path(paths) name = os.path.split(path)[1] self.copy_to_clipboard_and_inform(name) + def description(self): + return 'Copy Filename' + class SideBarCopyAbsolutePathCommand(SideBarCommand): + def run(self, paths): - path = paths[0] + path = self.get_path(paths) self.copy_to_clipboard_and_inform(path) + def description(self): + return 'Copy Absolute Path' + class SideBarCopyRelativePathCommand(SideBarCommand): + def run(self, paths): - path = paths[0] + path = self.get_path(paths) project_file_name = self.window.project_file_name() root_dir = '' if project_file_name: @@ -40,16 +56,23 @@ def run(self, paths): path = path[1:] self.copy_to_clipboard_and_inform(path) + def description(self): + return 'Copy Relative Path' + class SideBarCopyDirPathCommand(SideBarCommand): + def run(self, paths): - path = paths[0] + path = self.get_path(paths) self.copy_to_clipboard_and_inform(os.path.dirname(path)) + def description(self): + return 'Copy Directory Path' + class SideBarDuplicateCommand(SideBarCommand): def run(self, paths): self.view = self.window.active_view() - self.source = paths[0] + self.source = self.get_path(paths) base, leaf = os.path.split(self.source) name, ext = os.path.splitext(leaf) initial_text = name + ' (Copy)' + ext @@ -74,9 +97,15 @@ def copy(self, source, destination): if self.view: self.view.erase_status('ZZZ') + def description(self): + return 'Duplicate File…' + class SideBarOpenCommand(SideBarCommand): def run(self, paths): - path = paths[0] + path = self.get_path(paths) print(path) self.window.run_command('open_url', args={'url': path}) + + def description(self): + return 'Open With Default…' From b6569d068685c93b0c55ec34c4f882d2c36c5552 Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Sat, 25 Mar 2017 16:54:07 +0100 Subject: [PATCH 13/17] Remove OpenCommand Let users download the excellent "Open In Default Application" plugin located here: https://packagecontrol.io/packages/Open%20in%20Default%20Application it's pointless to have double functionality. --- Side Bar.sublime-menu | 5 ----- SideBar.py | 10 ---------- 2 files changed, 15 deletions(-) diff --git a/Side Bar.sublime-menu b/Side Bar.sublime-menu index 1398b9e9f..2117c41f7 100644 --- a/Side Bar.sublime-menu +++ b/Side Bar.sublime-menu @@ -31,10 +31,5 @@ "caption": "Duplicate…", "command": "side_bar_duplicate", "args": { "paths": [] } - }, - { - "caption": "Open With Default…", - "command": "side_bar_open", - "args": { "paths": [] } } ] diff --git a/SideBar.py b/SideBar.py index f2e1b9beb..7956b7380 100644 --- a/SideBar.py +++ b/SideBar.py @@ -99,13 +99,3 @@ def copy(self, source, destination): def description(self): return 'Duplicate File…' - -class SideBarOpenCommand(SideBarCommand): - - def run(self, paths): - path = self.get_path(paths) - print(path) - self.window.run_command('open_url', args={'url': path}) - - def description(self): - return 'Open With Default…' From 2411c797a81b17887d49b801b0436069ac84dcd5 Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Sat, 25 Mar 2017 17:09:01 +0100 Subject: [PATCH 14/17] Update readme.md --- readme.md | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/readme.md b/readme.md index 25ef2f38d..e1b06e54f 100644 --- a/readme.md +++ b/readme.md @@ -4,19 +4,28 @@ Some useful tools to add to your sidebar context menu and command palette: -- copy filename -- copy path -- copy full path -- duplicate -- open in default program +- Reveal In Sidebar +- Copy Filename +- Copy Relative Path +- Copy Absolute Path +- Copy Directory Path +- Duplicate -This package offers a tiny optimised subset of commands from the original [SidebarEnhancements](https://packagecontrol.io/packages/SideBarEnhancements), striking a balance somwhere between the bare minimum and the kitchen sink. +This package offers a tiny optimied subset of commands from the original +[SidebarEnhancements][1], striking a balance somwhere between the bare minimum +and the kitchen sink. -- The default context menu isn't replaced, this package just adds some useful new commands. +- The default context menu isn't replaced, this package just adds some useful + new commands. - It's tiny, fast and reliable. -- We won't [track](https://github.com/SideBarEnhancements-org/SideBarEnhancements/blob/d1c7fa4bac6a1f31ba177bc41ddd0ca902e43609/Stats.py) you. Ever. +- We won't [track][2] you. Ever. --------- -SidebarEnhancements © 2014 [Tito Bouzout](mailto:tito.bouzout@gmail.com) -License: [GNU GPL](http://www.gnu.org/licenses/gpl.html) +SidebarEnhancements © 2014 [Tito Bouzout][3] +License: [GNU GPL][4] + +[1]: https://packagecontrol.io/packages/SideBarEnhancements +[2]: https://github.com/SideBarEnhancements-org/SideBarEnhancements/blob/d1c7fa4bac6a1f31ba177bc41ddd0ca902e43609/Stats.py +[3]: mailto:tito.bouzout@gmail.com +[4]: http://www.gnu.org/licenses/gpl.html From cefae2658ecfb3d40310e1a22bbc201aaf2ada5b Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Sat, 25 Mar 2017 17:10:10 +0100 Subject: [PATCH 15/17] It's not an "optimised" subset, just a subset --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index e1b06e54f..aea347ee5 100644 --- a/readme.md +++ b/readme.md @@ -11,7 +11,7 @@ Some useful tools to add to your sidebar context menu and command palette: - Copy Directory Path - Duplicate -This package offers a tiny optimied subset of commands from the original +This package offers a subset of commands from the original [SidebarEnhancements][1], striking a balance somwhere between the bare minimum and the kitchen sink. From 7d0e488b4b223c52d94629eabf739e739b1f8ff3 Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Sat, 25 Mar 2017 17:14:24 +0100 Subject: [PATCH 16/17] Tell users about Open in Default App package --- readme.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readme.md b/readme.md index aea347ee5..3f9fed791 100644 --- a/readme.md +++ b/readme.md @@ -11,6 +11,9 @@ Some useful tools to add to your sidebar context menu and command palette: - Copy Directory Path - Duplicate +If you're missing the "Open With Default" command, consider fetching the +[Open in Default Application][5] package. + This package offers a subset of commands from the original [SidebarEnhancements][1], striking a balance somwhere between the bare minimum and the kitchen sink. @@ -29,3 +32,4 @@ License: [GNU GPL][4] [2]: https://github.com/SideBarEnhancements-org/SideBarEnhancements/blob/d1c7fa4bac6a1f31ba177bc41ddd0ca902e43609/Stats.py [3]: mailto:tito.bouzout@gmail.com [4]: http://www.gnu.org/licenses/gpl.html +[5]: https://packagecontrol.io/packages/Open%20in%20Default%20Application From 8123d93e021192cf7314c8648e0c7f2dd8c55bdb Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Sat, 25 Mar 2017 17:15:39 +0100 Subject: [PATCH 17/17] Fix typo in readme.md --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 3f9fed791..cbe7ca576 100644 --- a/readme.md +++ b/readme.md @@ -15,7 +15,7 @@ If you're missing the "Open With Default" command, consider fetching the [Open in Default Application][5] package. This package offers a subset of commands from the original -[SidebarEnhancements][1], striking a balance somwhere between the bare minimum +[SidebarEnhancements][1], striking a balance somewhere between the bare minimum and the kitchen sink. - The default context menu isn't replaced, this package just adds some useful