summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-10-07 16:55:33 +0200
committerhut <hut@lavabit.com>2011-10-07 16:55:33 +0200
commit13549f1e53c7342f040b20a3f3075778b1d3302b (patch)
tree7f7a333b5785056ea2e33fb52cda96a5da3d2074
parent6a3b4bca95d9341ac2a593c5935d463bb9d5e0cf (diff)
downloadranger-13549f1e53c7342f040b20a3f3075778b1d3302b.tar.gz
widgets.browserview: Try to fix crash
When running ranger with two directories and using a command with macros, this
crash happens.  To reproduce, run this and then type "yp"

ranger /usr/bin /var/tmp

Traceback was:

Ranger version: 1.5.0, executed with python 3.2.2
Locale: en_US.UTF-8
Current file: /usr/lib
Traceback (most recent call last):
  File "/home/common/archive/repos/ranger/ranger/core/main.py", line 103, in main
    fm.loop()
  File "/home/common/archive/repos/ranger/ranger/core/fm.py", line 202, in loop
    ui.handle_input()
  File "/home/common/archive/repos/ranger/ranger/gui/ui.py", line 210, in handle_input
    self.handle_key(key)
  File "/home/common/archive/repos/ranger/ranger/gui/ui.py", line 146, in handle_key
    self.press(key)
  File "/home/common/archive/repos/ranger/ranger/gui/ui.py", line 161, in press
    quantifier=keybuffer.quantifier)
  File "/home/common/archive/repos/ranger/ranger/core/actions.py", line 111, in execute_console
    string = self.substitute_macros(string, additional=macros)
  File "/home/common/archive/repos/ranger/ranger/core/actions.py", line 115, in substitute_macros
    return _MacroTemplate(string).safe_substitute(self._get_macros(),
  File "/home/common/archive/repos/ranger/ranger/core/actions.py", line 153, in _get_macros
    macros[i + 'f'] = shell_quote(tab_dir.pointed_obj.path)
AttributeError: 'NoneType' object has no attribute 'path'
-rw-r--r--ranger/gui/widgets/browserview.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/ranger/gui/widgets/browserview.py b/ranger/gui/widgets/browserview.py
index 12e1d9bd..84f77de6 100644
--- a/ranger/gui/widgets/browserview.py
+++ b/ranger/gui/widgets/browserview.py
@@ -98,6 +98,11 @@ class BrowserView(Widget, DisplayableContainer):
 			self.win.erase()
 			self.need_redraw = True
 			self.need_clear = False
+		for path in self.fm.tabs.values():
+			if path is not None:
+				directory = self.env.get_directory(path)
+				directory.load_content_if_outdated()
+				directory.use()
 		DisplayableContainer.draw(self)
 		if self.settings.draw_borders:
 			self._draw_borders()
h=v1.7.0&id=7bf5f9672ee79489553506831b7cab54a8609077'>7bf5f967 ^
7dc8fef8 ^
4833bc23 ^

4ea0f69a ^

240394a4 ^

240394a4 ^

dc4216a5 ^
7dc8fef8 ^
9e89f023 ^
36e4e71e ^
20ab9343 ^

20ab9343 ^





4ea0f69a ^

240394a4 ^
7dc8fef8 ^
36e4e71e ^

4a383291 ^
78a7d762 ^
e952d6cb ^
78a7d762 ^
e952d6cb ^
4ea0f69a ^

7838675f ^

07069888 ^

07069888 ^
7838675f ^

1891697f ^
755e7df1 ^
a3d5f44b ^
66a8d4ff ^
7838675f ^
7dc8fef8 ^
80a93f0b ^
500cf259 ^

7dc8fef8 ^


80a93f0b ^
240394a4 ^



240394a4 ^
7dc8fef8 ^
240394a4 ^

96004e71 ^
240394a4 ^

96004e71 ^
240394a4 ^



e5fb3d74 ^
240394a4 ^

240394a4 ^
7dc8fef8 ^



7b33b517 ^

176e8a68 ^
7b33b517 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100