From 291bf4d835ccc348530a488522d285541b897d69 Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Tue, 24 Jul 2018 12:27:33 -0400 Subject: [PATCH] Pass maxDigits to labelFn --- src/text-editor-component.js | 2 +- src/text-editor.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/text-editor-component.js b/src/text-editor-component.js index 4a3fc789c..5f7cbdcbc 100644 --- a/src/text-editor-component.js +++ b/src/text-editor-component.js @@ -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}) } } diff --git a/src/text-editor.js b/src/text-editor.js index 3cac563b5..ba063f7f0 100644 --- a/src/text-editor.js +++ b/src/text-editor.js @@ -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.