Skip to content

Commit 0173432

Browse files
committed
Fix FmRenamePath with empty paths arguments
All Fm...Commands are designed to use the active view's file_name() if no paths list is passed as argument. This feature enables such commands to be used in the `Tab Context.sublime-menu`. Therefore we add that feature to the FmRenamePath as well.
1 parent 9126c8c commit 0173432

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

commands/rename.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212

1313

1414
class FmRenamePathCommand(FmWindowCommand):
15-
def run(self, paths):
16-
self.window.run_command("rename_path", {"paths": paths})
15+
def run(self, paths=None):
16+
self.window.run_command(
17+
"rename_path", {"paths": paths or [self.window.active_view().file_name()]}
18+
)
1719

1820

1921
class FmRenameCommand(FmWindowCommand):

0 commit comments

Comments
 (0)