updated to v.1.10.2

This commit is contained in:
Dan Remollino
2023-03-27 19:14:40 -04:00
parent c5809ab773
commit 60e8c4ef1d
3 changed files with 22 additions and 7 deletions

View File

@ -1,5 +1,8 @@
## Version 1.10.2
- fixed right border not vertically aligning when right padding was set to 0
## Version 1.10.1
- fixed right border not vertically aligning for some characters
- fixed right padding not vertically aligning for transformations ending in certain characters
## Version 1.10
- added Borders option to add custom borders

View File

@ -154,9 +154,14 @@ nova.commands.register('figletTextEditor', editor => {
break
case 'right':
figletTextArr = figletTextArr.map(line => {
// nova.commands.register.figlet trims whitespace
// per line; they will not all be the same length
let additionalRightPadding = (borders.left.padding + longestLine + borders.right.padding) - (borders.left.padding + line.length + borders.right.padding)
if ( additionalRightPadding > 0) line = `${line}${' '.repeat(additionalRightPadding)}`
if (!/^\s+$/.test(line)) return `${line}${' '.repeat(borders.right.padding)}`
if (!/^\s+$/.test(line)) {
if (additionalRightPadding > 0) line = `${line}${' '.repeat(additionalRightPadding)}`
return `${line}${' '.repeat(borders.right.padding)}`
}
})
break
case 'top':
@ -195,7 +200,14 @@ nova.commands.register('figletTextEditor', editor => {
break
case 'right':
figletTextArr = figletTextArr.map(line => {
if (!/^\s+$/.test(line)) { return `${line}${borders[border].char.repeat(borders[border].width)}` }
// nova.commands.register.figlet trims whitespace
// per line; they will not all be the same length
let additionalRightPadding = (borders.left.padding + longestLine + borders.right.padding) - (borders.left.padding + line.length + borders.right.padding)
if (!/^\s+$/.test(line)) {
if (additionalRightPadding > 0) line = `${line}${' '.repeat(additionalRightPadding)}`
return `${line}${borders[border].char.repeat(borders[border].width)}`
}
})
break
case 'top':

View File

@ -3,7 +3,7 @@
"name": "FIGlet Text",
"organization": "Dan Remollino",
"description": "Convert selected text to FIGlet. Great for adding readable text to the Minimap, creating l33t text headers, and organizing files.",
"version": "1.10.1",
"version": "1.10.2",
"categories": ["commands", "formatters"],
"entitlements": {
@ -611,7 +611,7 @@
"key": "figlet_text.borderRightPadding",
"title": "Right Padding",
"type": "number",
"default": 5
"default": 4
},
{
"key": "figlet_text.borderBottomPadding",
@ -623,7 +623,7 @@
"key": "figlet_text.borderLeftPadding",
"title": "Left Padding",
"type": "number",
"default": 5
"default": 4
}
]
},