diff --git a/decor/decorator.go b/decor/decorator.go index f537d3f..382d339 100644 --- a/decor/decorator.go +++ b/decor/decorator.go @@ -8,14 +8,14 @@ ) const ( - // DidentRight bit specifies identation direction. + // DindentRight sets indentation from right to left. // - // |foo |b | With DidentRight - // | foo| b| Without DidentRight - DidentRight = 1 << iota + // |foo |b | DindentRight is set + // | foo| b| DindentRight is not set + DindentRight = 1 << iota // DextraSpace bit adds extra space, makes sense with DSyncWidth only. - // When DidentRight bit set, the space will be added to the right, + // When DindentRight bit set, the space will be added to the right, // otherwise to the left. DextraSpace @@ -23,14 +23,14 @@ // Effective with multiple bars only. DSyncWidth - // DSyncWidthR is shortcut for DSyncWidth|DidentRight - DSyncWidthR = DSyncWidth | DidentRight + // DSyncWidthR is shortcut for DSyncWidth|DindentRight + DSyncWidthR = DSyncWidth | DindentRight // DSyncSpace is shortcut for DSyncWidth|DextraSpace DSyncSpace = DSyncWidth | DextraSpace - // DSyncSpaceR is shortcut for DSyncWidth|DextraSpace|DidentRight - DSyncSpaceR = DSyncWidth | DextraSpace | DidentRight + // DSyncSpaceR is shortcut for DSyncWidth|DextraSpace|DindentRight + DSyncSpaceR = DSyncWidth | DextraSpace | DindentRight ) // TimeStyle enum. @@ -156,7 +156,7 @@ // Init initializes width related config. func (wc *WC) Init() WC { - if (wc.C & DidentRight) != 0 { + if (wc.C & DindentRight) != 0 { wc.fill = runewidth.FillRight } else { wc.fill = runewidth.FillLeft diff --git a/decorators_test.go b/decorators_test.go index 56e7a4b..61e4b60 100644 --- a/decorators_test.go +++ b/decorators_test.go @@ -25,7 +25,7 @@ want: " Test", }, { - decorator: decor.Name("Test", decor.WC{W: 10, C: decor.DidentRight}), + decorator: decor.Name("Test", decor.WC{W: 10, C: decor.DindentRight}), want: "Test ", }, } diff --git a/example_test.go b/example_test.go index 6d6ccfe..4868d58 100644 --- a/example_test.go +++ b/example_test.go @@ -22,7 +22,7 @@ mpb.BarStyle().Lbound("╢").Filler("▌").Tip("▌").Padding("░").Rbound("╟"), mpb.PrependDecorators( // display our name with one space on the right - decor.Name(name, decor.WC{W: len(name) + 1, C: decor.DidentRight}), + decor.Name(name, decor.WC{W: len(name) + 1, C: decor.DindentRight}), // replace ETA decorator with "done" message, OnComplete event decor.OnComplete( decor.AverageETA(decor.ET_STYLE_GO, decor.WC{W: 4}), "done",