From 740261f127d52bc612674a2bb7a9794c587d5b0a Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 14 Nov 2015 14:56:28 +0100 Subject: Added :echo command, disabled :notify command --- doc/ranger.1 | 6 +++++- doc/ranger.pod | 5 +++++ ranger/config/commands.py | 10 ++++++++++ ranger/core/main.py | 2 +- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index f426d5c6..6ec463b6 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -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 @@ -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] @@ -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. diff --git a/doc/ranger.pod b/doc/ranger.pod index 6c66f817..e1a8d032 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -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] @@ -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 + +Display the text in the statusbar. + =item edit [I] Edit the current file or the file in the argument. diff --git a/ranger/config/commands.py b/ranger/config/commands.py index 4f7f109a..0dc22147 100644 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -98,6 +98,16 @@ class alias(Command): else: self.fm.commands.alias(self.arg(1), self.rest(2)) + +class echo(Command): + """:echo + + Display the text in the statusbar. + """ + def execute(self): + self.fm.notify(self.rest(1)) + + class cd(Command): """:cd [-r] diff --git a/ranger/core/main.py b/ranger/core/main.py index 55102dc2..96f56bf1 100644 --- a/ranger/core/main.py +++ b/ranger/core/main.py @@ -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) -- cgit 1.4.1-2-gfad0