Skip to content

Commit

Permalink
chore: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Oct 3, 2024
1 parent 1332fe3 commit eae8041
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,10 @@ function formatTextWithMargins({

if (overflow === 'wrap') {
const wrappedText = wrapAnsi(valueWithNoZeroWidthChars, spaceForText, {hard: true, trim: true, wordWrap: true})
const spaces = width - determineWidthOfWrappedText(stripAnsi(wrappedText))
const {marginLeft, marginRight} = calculateMargins(spaces)
const {marginLeft, marginRight} = calculateMargins(width - determineWidthOfWrappedText(stripAnsi(wrappedText)))

const lines = wrappedText.split('\n').map((line, idx) => {
const {marginLeft: lineSpecificLeftMargin} = calculateMargins(width - stripAnsi(line).length)
// if (idx === 0) {
// // if it's the first line, only add margin to the right side (The left margin will be applied later)
// return `${line}${' '.repeat(marginRight)}`
// }

if (horizontalAlignment === 'left') {
if (idx === 0) {
Expand Down

0 comments on commit eae8041

Please sign in to comment.