From 0d7171c2f8fe155d8a715f4704495085736a684a Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 3 Oct 2011 15:58:16 +0200 Subject: defaults/commands: Added copypmap, copytmap, copycmap --- ranger/defaults/commands.py | 26 +++++++++++++++++++++++++- ranger/ext/keybindings.py | 5 ++++- ranger/gui/ui.py | 1 - 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/ranger/defaults/commands.py b/ranger/defaults/commands.py index a9a232b9..61f6f0cd 100644 --- a/ranger/defaults/commands.py +++ b/ranger/defaults/commands.py @@ -820,7 +820,7 @@ class help_(Command): class copymap(Command): """ :copymap [...] - Copies a keybinding from to + Copies a "browser" keybinding from to """ context = 'browser' @@ -832,6 +832,30 @@ class copymap(Command): self.fm.env.keymaps.copy(self.context, self.arg(1), arg) +class copypmap(copymap): + """ + :copypmap [...] + Copies a "pager" keybinding from to + """ + context = 'pager' + + +class copycmap(copymap): + """ + :copycmap [...] + Copies a "console" keybinding from to + """ + context = 'console' + + +class copytmap(copymap): + """ + :copycmap [...] + Copies a "taskview" keybinding from to + """ + context = 'taskview' + + class unmap(Command): """ :unmap [, ...] diff --git a/ranger/ext/keybindings.py b/ranger/ext/keybindings.py index 950cae1d..37cceb10 100644 --- a/ranger/ext/keybindings.py +++ b/ranger/ext/keybindings.py @@ -64,7 +64,10 @@ class KeyMaps(dict): last_key = keys[-1] for key in keys[:-1]: try: - pointer = pointer[key] + if isinstance(pointer[key], dict): + pointer = pointer[key] + else: + pointer[key] = pointer = dict() except: pointer[key] = pointer = dict() pointer[last_key] = leaf diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py index 93f3da8e..c103fe12 100644 --- a/ranger/gui/ui.py +++ b/ranger/gui/ui.py @@ -336,7 +336,6 @@ class UI(DisplayableContainer): self.browser.visible = False self.taskview.visible = True self.taskview.focused = True - self.fm.hint('*tasks:* *dd*:remove *J*:move_down *H*:move_up') def redraw_main_column(self): self.browser.main_column.need_redraw = True -- cgit 1.4.1-2-gfad0