Skip to content

Commit

Permalink
Added :echo command, disabled :notify command
Browse files Browse the repository at this point in the history
  • Loading branch information
hut committed Nov 14, 2015
1 parent 84247cf commit 740261f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
6 changes: 5 additions & 1 deletion doc/ranger.1
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RANGER 1"
.TH RANGER 1 "ranger-1.7.2" "10/04/2015" "ranger manual"
.TH RANGER 1 "ranger-1.7.2" "11/14/2015" "ranger manual"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
Expand Down Expand Up @@ -855,6 +855,7 @@ ranger. For your convenience, this is a list of the \*(L"public\*(R" commands i
\& cunmap keys...
\& default_linemode [path=regexp | tag=tags] linemodename
\& delete
\& echo [text]
\& edit [filename]
\& eval [\-q] python_code
\& filter [string]
Expand Down Expand Up @@ -981,6 +982,9 @@ Set the default linemode for all files in ~/books/ to \*(L"metatitle\*(R":
Destroy all files in the selection with a roundhouse kick. ranger will ask for
a confirmation if you attempt to delete multiple (marked) files or non-empty
directories. This can be changed by modifying the setting \*(L"confirm_on_delete\*(R".
.IP "echo \fItext\fR" 2
.IX Item "echo text"
Display the text in the statusbar.
.IP "edit [\fIfilename\fR]" 2
.IX Item "edit [filename]"
Edit the current file or the file in the argument.
Expand Down
5 changes: 5 additions & 0 deletions doc/ranger.pod
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,7 @@ ranger. For your convenience, this is a list of the "public" commands including
cunmap keys...
default_linemode [path=regexp | tag=tags] linemodename
delete
echo [text]
edit [filename]
eval [-q] python_code
filter [string]
Expand Down Expand Up @@ -1015,6 +1016,10 @@ Destroy all files in the selection with a roundhouse kick. ranger will ask for
a confirmation if you attempt to delete multiple (marked) files or non-empty
directories. This can be changed by modifying the setting "confirm_on_delete".

=item echo I<text>

Display the text in the statusbar.

=item edit [I<filename>]

Edit the current file or the file in the argument.
Expand Down
10 changes: 10 additions & 0 deletions ranger/config/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@ def execute(self):
else:
self.fm.commands.alias(self.arg(1), self.rest(2))


class echo(Command):
""":echo <text>
Display the text in the statusbar.
"""
def execute(self):
self.fm.notify(self.rest(1))


class cd(Command):
""":cd [-r] <dirname>
Expand Down
2 changes: 1 addition & 1 deletion ranger/core/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def load_settings(fm, clean):

# Load default commands
fm.commands = ranger.api.commands.CommandContainer()
exclude = ['settings']
exclude = ['settings', 'notify']
include = [name for name in dir(Actions) if name not in exclude]
fm.commands.load_commands_from_object(fm, include)
fm.commands.load_commands_from_module(commands)
Expand Down

0 comments on commit 740261f

Please sign in to comment.