From fd51fa3da2848859ba722bac45178c24845d17d0 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 16 Aug 2010 22:35:03 +0200 Subject: Fixed exception when using %f macros in special cases --- ranger/gui/widgets/console.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py index f02a4b01..ff8d137a 100644 --- a/ranger/gui/widgets/console.py +++ b/ranger/gui/widgets/console.py @@ -498,7 +498,8 @@ class OpenConsole(ConsoleWithTab): tab_dir = self.fm.env.get_directory(tab_dir_path) i = str(i) macros[i + 'd'] = shell_quote(tab_dir_path) - macros[i + 'f'] = shell_quote(tab_dir.pointed_obj.path) + if tab_dir.pointed_obj: + macros[i + 'f'] = shell_quote(tab_dir.pointed_obj.path) macros[i + 's'] = ' '.join(shell_quote(fl.path) for fl in tab_dir.get_selection()) @@ -519,7 +520,8 @@ class OpenConsole(ConsoleWithTab): next_tab = self.fm.env.get_directory(next_tab_path) macros['D'] = shell_quote(next_tab) - macros['F'] = shell_quote(next_tab.pointed_obj.path) + if next_tab.pointed_obj: + macros['F'] = shell_quote(next_tab.pointed_obj.path) macros['S'] = ' '.join(shell_quote(fl.path) for fl in next_tab.get_selection()) -- cgit 1.4.1-2-gfad0