Pass maxDigits to labelFn

This commit is contained in:
Ash Wilson
2018-07-24 12:27:33 -04:00
parent fdf5d50196
commit 291bf4d835
2 changed files with 2 additions and 1 deletions

View File

@@ -3236,7 +3236,7 @@ class LineNumberGutterComponent {
number = softWrapped ? '•' : bufferRow + 1
number = NBSP_CHARACTER.repeat(maxDigits - number.length) + number
} else {
number = this.props.labelFn({bufferRow, screenRow, foldable, softWrapped})
number = this.props.labelFn({bufferRow, screenRow, foldable, softWrapped, maxDigits})
}
}

View File

@@ -4227,6 +4227,7 @@ class TextEditor {
// * `screenRow` {Number} indicating the zero-indexed screen index.
// * `foldable` {Boolean} that is `true` if a fold may be created here.
// * `softWrapped` {Boolean} if this screen row is the soft-wrapped continuation of the same buffer row.
// * `maxDigits` {Number} the maximum number of digits necessary to represent any known screen row.
// * `onMouseDown` (optional) {Function} to be called when a mousedown event is received by a line-number
// element within this `type: 'line-number'` {Gutter}. If unspecified, the default behavior is to select the
// clicked buffer row.