| 7 | 7 |
)
|
| 8 | 8 |
|
| 9 | 9 |
const (
|
| 10 | |
// DidentRight bit specifies identation direction.
|
|
10 |
// DindentRight sets indentation from right to left.
|
| 11 | 11 |
//
|
| 12 | |
// |foo |b | With DidentRight
|
| 13 | |
// | foo| b| Without DidentRight
|
| 14 | |
DidentRight = 1 << iota
|
|
12 |
// |foo |b | DindentRight is set
|
|
13 |
// | foo| b| DindentRight is not set
|
|
14 |
DindentRight = 1 << iota
|
| 15 | 15 |
|
| 16 | 16 |
// DextraSpace bit adds extra space, makes sense with DSyncWidth only.
|
| 17 | |
// When DidentRight bit set, the space will be added to the right,
|
|
17 |
// When DindentRight bit set, the space will be added to the right,
|
| 18 | 18 |
// otherwise to the left.
|
| 19 | 19 |
DextraSpace
|
| 20 | 20 |
|
|
| 22 | 22 |
// Effective with multiple bars only.
|
| 23 | 23 |
DSyncWidth
|
| 24 | 24 |
|
| 25 | |
// DSyncWidthR is shortcut for DSyncWidth|DidentRight
|
| 26 | |
DSyncWidthR = DSyncWidth | DidentRight
|
|
25 |
// DSyncWidthR is shortcut for DSyncWidth|DindentRight
|
|
26 |
DSyncWidthR = DSyncWidth | DindentRight
|
| 27 | 27 |
|
| 28 | 28 |
// DSyncSpace is shortcut for DSyncWidth|DextraSpace
|
| 29 | 29 |
DSyncSpace = DSyncWidth | DextraSpace
|
| 30 | 30 |
|
| 31 | |
// DSyncSpaceR is shortcut for DSyncWidth|DextraSpace|DidentRight
|
| 32 | |
DSyncSpaceR = DSyncWidth | DextraSpace | DidentRight
|
|
31 |
// DSyncSpaceR is shortcut for DSyncWidth|DextraSpace|DindentRight
|
|
32 |
DSyncSpaceR = DSyncWidth | DextraSpace | DindentRight
|
| 33 | 33 |
)
|
| 34 | 34 |
|
| 35 | 35 |
// TimeStyle enum.
|
|
| 155 | 155 |
|
| 156 | 156 |
// Init initializes width related config.
|
| 157 | 157 |
func (wc *WC) Init() WC {
|
| 158 | |
if (wc.C & DidentRight) != 0 {
|
|
158 |
if (wc.C & DindentRight) != 0 {
|
| 159 | 159 |
wc.fill = runewidth.FillRight
|
| 160 | 160 |
} else {
|
| 161 | 161 |
wc.fill = runewidth.FillLeft
|