Skip to content

Commit 4645f59

Browse files
committed
remove Copy Absolute Path >= 4158 (sidebar only)
because it duplicates the Copy Path sidebar context entry of ST itself
1 parent 8148127 commit 4645f59

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Commands.sublime-commands

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{
1818
"caption": "File: Copy Absolute Path",
1919
"command": "side_bar_copy_absolute_path",
20-
"args": { "paths": [] }
20+
"args": { "paths": [], "trigger": "palette" }
2121
},
2222
{
2323
"caption": "File: Duplicate…",
@@ -39,8 +39,8 @@
3939
"command": "edit_settings",
4040
"args":
4141
{
42-
"base_file": "${packages}/SideBarTools/SideBarTools.sublime-settings",
43-
"default": "// SideBarTools Settings - User\n{\n\t$0\n}\n"
42+
"base_file": "${packages}/SideBarTools/SideBarTools.sublime-settings",
43+
"default": "// SideBarTools Settings - User\n{\n\t$0\n}\n"
4444
}
4545
}
4646
]

SideBar.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ def description(self):
9191

9292
class SideBarCopyAbsolutePathCommand(MultipleFilesMixin, SideBarCommand):
9393

94+
def is_visible(self, paths=[], trigger=""):
95+
# in 4158 ST gets the "copy path" sidebar context entry
96+
# we want to keep our command palette entry though
97+
if trigger != 'palette' and int(sublime.version()) >= 4158:
98+
return False
99+
return super().is_visible(paths)
100+
94101
def run(self, paths=[]):
95102
paths = self.get_paths(paths)
96103
self.copy_to_clipboard_and_inform('\n'.join(paths))

0 commit comments

Comments
 (0)