Codebase list golang-github-vbauerster-mpb / fb2ad71
make DextraSpace effective regardless of DSyncWidth Vladimir Bauer 2 years ago
1 changed file(s) with 3 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
1313 // | foo| b| DindentRight is not set
1414 DindentRight = 1 << iota
1515
16 // DextraSpace bit adds extra space, makes sense with DSyncWidth only.
17 // When DindentRight bit set, the space will be added to the right,
18 // otherwise to the left.
16 // DextraSpace bit adds extra indentation space.
1917 DextraSpace
2018
2119 // DSyncWidth bit enables same column width synchronization.
142140 viewWidth := runewidth.StringWidth(str)
143141 if wc.W > viewWidth {
144142 viewWidth = wc.W
143 } else if (wc.C & DextraSpace) != 0 {
144 viewWidth++
145145 }
146146 if (wc.C & DSyncWidth) != 0 {
147 if (wc.C & DextraSpace) != 0 {
148 viewWidth++
149 }
150147 wc.wsync <- viewWidth
151148 viewWidth = <-wc.wsync
152149 }