diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-05-13 13:20:59 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-05-13 13:20:59 -0300 |
commit | 34b7ff22766bae0e4b1b3121bd63d037c27285c7 (patch) | |
tree | f2f66a17c67bdf9be0b1576b28ffd0cf107b483c /ui/presentation/WrapLabel.js | |
parent | 684e369c7b01b4c69995fc604ef33919077ffdf5 (diff) | |
parent | a37d6be77261b2aae25c4235dcb38dd7b1bb60b1 (diff) |
Merge remote-tracking branch 'notabug/master'
Diffstat (limited to 'ui/presentation/WrapLabel.js')
-rw-r--r-- | ui/presentation/WrapLabel.js | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/ui/presentation/WrapLabel.js b/ui/presentation/WrapLabel.js index 0ecc777..eae8960 100644 --- a/ui/presentation/WrapLabel.js +++ b/ui/presentation/WrapLabel.js @@ -1,5 +1,3 @@ -import wrap from 'word-wrap' - import * as ansi from 'tui-lib/util/ansi' import Label from './Label.js' @@ -21,7 +19,7 @@ export default class WrapLabel extends Label { const lines = this.getWrappedLines() for (let i = 0; i < lines.length; i++) { writable.write(ansi.moveCursor(this.absTop + i, this.absLeft)) - writable.write(lines[i]) + writable.write(this.processFormatting(lines[i])) } } @@ -30,9 +28,7 @@ export default class WrapLabel extends Label { return [] } - const options = {width: this.w, indent: ''} - return wrap(this.text, options).split('\n') - .map(l => l.trim()) + return ansi.wrapToColumns(this.text, this.w - 1).map(l => l.trim()) } get h() { |