File tree 1 file changed +3
-6
lines changed
1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,7 @@ const (
14
14
// | foo| b| DindentRight is not set
15
15
DindentRight = 1 << iota
16
16
17
- // DextraSpace bit adds extra space, makes sense with DSyncWidth only.
18
- // When DindentRight bit set, the space will be added to the right,
19
- // otherwise to the left.
17
+ // DextraSpace bit adds extra indentation space.
20
18
DextraSpace
21
19
22
20
// DSyncWidth bit enables same column width synchronization.
@@ -143,11 +141,10 @@ func (wc WC) Format(str string) (string, int) {
143
141
viewWidth := runewidth .StringWidth (str )
144
142
if wc .W > viewWidth {
145
143
viewWidth = wc .W
144
+ } else if (wc .C & DextraSpace ) != 0 {
145
+ viewWidth ++
146
146
}
147
147
if (wc .C & DSyncWidth ) != 0 {
148
- if (wc .C & DextraSpace ) != 0 {
149
- viewWidth ++
150
- }
151
148
wc .wsync <- viewWidth
152
149
viewWidth = <- wc .wsync
153
150
}
You can’t perform that action at this time.
0 commit comments