You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'd be cool, although probably a bit unnecessary and overcomplicated, if for example when truncating at the end the style of the character preceding the ellipses is detected and the ellipsis is written using the same style.
The text was updated successfully, but these errors were encountered:
Example use case (basically any line that uses any styles):
import{color}from'specialist';importtruncatefrom'cli-truncate';importwidthfrom'cli-width';// Example - CodeconstlineCurrent=truncate(`${color.cyan('title')}${color.dim('desc'.repeat(1000))}`,width());constlineWanted=truncate(`${color.cyan('title')}${color.dim('desc'.repeat(1000).slice(0,width()-7))}${color.dim('…')}`,width());// I don't want to write this, it's just a hard-coded way to produce the wanted outputconsole.log('Example - Visual - Current');console.log(lineCurrent);console.log();console.log('Example - Visual - Wanted');console.log(lineWanted);
Example visual output (basically the ellipsis just looks nice given the style at the truncation point):
It'd be cool, although probably a bit unnecessary and overcomplicated, if for example when truncating at the end the style of the character preceding the ellipses is detected and the ellipsis is written using the same style.
The text was updated successfully, but these errors were encountered: