summary refs log tree commit diff stats
path: root/ranger/gui/widgets/browsercolumn.py
diff options
context:
space:
mode:
Diffstat (limited to 'ranger/gui/widgets/browsercolumn.py')
-rw-r--r--ranger/gui/widgets/browsercolumn.py48
1 files changed, 27 insertions, 21 deletions
diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py
index a4ba7eea..d705e6ba 100644
--- a/ranger/gui/widgets/browsercolumn.py
+++ b/ranger/gui/widgets/browsercolumn.py
@@ -265,27 +265,33 @@ class BrowserColumn(Pager):
             # colorscheme, to compute the curses attribute.
             predisplay_left = []
             predisplay_right = []
-
-            predisplay_left += self._draw_tagged_display(tagged, tagged_marker)
-            predisplay_right += self._draw_vcsstring_display(drawn)
-            space = self.wid - self._total_len(predisplay_left) - \
-                    self._total_len(predisplay_right)
-
-            # If not enough space
-            if space <= 2:
-                del predisplay_right[:]
-                del predisplay_left[:]
-
+            space = self.wid
+
+            # selection mark
+            tagmark = self._draw_tagged_display(tagged, tagged_marker)
+            tagmarklen = self._total_len(tagmark)
+            if space - tagmarklen > 2:
+                predisplay_left += tagmark
+                space -= tagmarklen
+
+            # vcs data
+            vcsstring = self._draw_vcsstring_display(drawn)
+            vcsstringlen = self._total_len(vcsstring)
+            if space - vcsstringlen > 2:
+                predisplay_right += vcsstring
+                space -= vcsstringlen
+
+            # info string
             infostring = self._draw_infostring_display(drawn, space)
-            space -= self._total_len(infostring)
-
-            predisplay_left += self._draw_text_display(text, space)
-            space = self.wid - self._total_len(predisplay_left) - \
-                    self._total_len(predisplay_right)
+            infostringlen = self._total_len(infostring)
+            if space - infostringlen > 2:
+                predisplay_right = infostring + predisplay_right
+                space -= infostringlen
 
-            predisplay_right = infostring + predisplay_right
-            space = self.wid - self._total_len(predisplay_left) - \
-                    self._total_len(predisplay_right)
+            textstring = self._draw_text_display(text, space)
+            textstringlen = self._total_len(textstring)
+            predisplay_left += textstring
+            space -= textstringlen
 
             if space > 0:
                 predisplay_left.append([' ' * space, []])
@@ -314,9 +320,9 @@ class BrowserColumn(Pager):
 
     def _draw_text_display(self, text, space):
         wtext = WideString(text)
+        wellip = WideString(self.ellipsis[self.settings.unicode_ellipsis])
         if len(wtext) > space:
-            wtext = wtext[:max(0, space - 1)] + \
-                self.ellipsis[self.settings.unicode_ellipsis]
+            wtext = wtext[:max(0, space - len(wellip))] + wellip
 
         return [[str(wtext), []]]
 
d83e6752cf6506c78c9454c08b9f3df9371c'>94c5d83e ^
423ce88a ^

94c5d83e ^








e9e4b4ff ^

50a0cb1c ^
e9e4b4ff ^

606df33e ^
e9e4b4ff ^
fde932f2 ^
e9e4b4ff ^


2c5ea01d ^
e9e4b4ff ^




e9e4b4ff ^

2c5ea01d ^
e9e4b4ff ^
0c2c782d ^

6ac4be61 ^
ea775b1c ^








6ac4be61 ^
ea775b1c ^

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