summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/gui/widgets/browsercolumn.py26
1 files changed, 19 insertions, 7 deletions
diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py
index d617e64e..6ed9ce6b 100644
--- a/ranger/gui/widgets/browsercolumn.py
+++ b/ranger/gui/widgets/browsercolumn.py
@@ -28,6 +28,7 @@ class BrowserColumn(Pager):
 	target = None
 	tagged_marker = '*'
 	last_redraw_time = -1
+	ellipsis = "~"
 
 	old_dir = None
 	old_cf = None
@@ -207,11 +208,24 @@ class BrowserColumn(Pager):
 			except IndexError:
 				break
 
+			if self.display_infostring and drawn.infostring \
+					and self.settings.display_size_in_main_column:
+				infostring = str(drawn.infostring) + " "
+			else:
+				infostring = ""
+
 			bad_info_color = None
 			this_color = base_color + list(drawn.mimetype_tuple)
 			text = drawn.basename
 			tagged = self.fm.tags and drawn.realpath in self.fm.tags
 
+			space = self.wid - len(infostring)
+			if self.main_column:
+				space -= 2
+
+			if len(text) > space:
+				text = text[:space-1] + self.ellipsis
+
 			if i == selected_i:
 				this_color.append('selected')
 
@@ -257,14 +271,12 @@ class BrowserColumn(Pager):
 			else:
 				self.addnstr(line, 0, text, self.wid)
 
-			if self.display_infostring and drawn.infostring \
-					and self.settings.display_size_in_main_column:
-				info = drawn.infostring
-				x = self.wid - 1 - len(info)
-				if info is BAD_INFO:
-					bad_info_color = (x, len(str(info)))
+			if infostring:
+				x = self.wid - 1 - len(infostring)
+				if infostring is BAD_INFO:
+					bad_info_color = (x, len(infostring))
 				if x > 0:
-					self.addstr(line, x, str(info) + ' ')
+					self.addstr(line, x, infostring)
 
 			self.color_at(line, 0, self.wid, this_color)
 			if bad_info_color:
-8-2dev_5' href='/ingrix/lynx-snapshots/commit/src/LYKeymap.h?id=d4a8ec3c8922a91d418bb9bc130c256c4e00d030'>d4a8ec3c ^
e087f6d4
d3f9d547 ^
e087f6d4

36863953 ^








e087f6d4

36863953 ^


e087f6d4






36863953 ^

e087f6d4








36863953 ^



923c66ce ^





36863953 ^
923c66ce ^
36863953 ^


923c66ce ^


36863953 ^

923c66ce ^

945e8eb6 ^




36863953 ^








945e8eb6 ^

97d3287a ^

55ebd12c ^
e087f6d4
945e8eb6 ^
55ebd12c ^
945e8eb6 ^
55ebd12c ^
945e8eb6 ^


55ebd12c ^
945e8eb6 ^

36863953 ^
e087f6d4
945e8eb6 ^





e087f6d4
36863953 ^
d3f9d547 ^







e087f6d4
97d3287a ^


e087f6d4


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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141