From d721c7a5f9fa2c26e97e616542b516daced4dc08 Mon Sep 17 00:00:00 2001 From: Raphael McSinyx Date: Sun, 6 Aug 2017 00:36:31 +0700 Subject: Update 2017-08-06 --- ranger/.config/ranger/commands.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'ranger/.config/ranger/commands.py') diff --git a/ranger/.config/ranger/commands.py b/ranger/.config/ranger/commands.py index 2df405f..1386e84 100644 --- a/ranger/.config/ranger/commands.py +++ b/ranger/.config/ranger/commands.py @@ -8,13 +8,15 @@ from ranger.api.commands import * # A simple command for demonstration purposes follows. -#------------------------------------------------------------------------------ +# ----------------------------------------------------------------------------- # You can import any python module as needed. import os # Any class that is a subclass of "Command" will be integrated into ranger as a # command. Try typing ":my_edit" in ranger! + + class my_edit(Command): # The so-called doc-string of the class will be visible in the built-in # help that is accessible by typing "?c" inside ranger. @@ -37,7 +39,7 @@ class my_edit(Command): # reference to the currently selected file. target_filename = self.fm.thisfile.path - # This is a generic function to print text in ranger. + # This is a generic function to print text in ranger. self.fm.notify("Let's edit the file " + target_filename + "!") # Using bad=True in fm.notify allows you to print error messages: @@ -52,7 +54,8 @@ class my_edit(Command): # The tab method is called when you press tab, and should return a list of # suggestions that the user will tab through. - def tab(self): + # tabnum is 1 for and -1 for by default + def tab(self, tabnum): # This is a generic tab-completion function that iterates through the # content of the current directory. return self._tab_directory_content() -- cgit 1.4.1