From 941844d99aa214a55e2cbd2be7efef1c9c10fa9f Mon Sep 17 00:00:00 2001 From: Dan Remollino Date: Fri, 31 Mar 2023 01:05:51 -0400 Subject: [PATCH] updated to v1.13 --- FIGlet Text.novaextension/CHANGELOG.md | 3 +++ FIGlet Text.novaextension/Scripts/main.js | 9 +++++---- FIGlet Text.novaextension/extension.json | 16 +++++++++++++--- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/FIGlet Text.novaextension/CHANGELOG.md b/FIGlet Text.novaextension/CHANGELOG.md index 5d56404..574bc1c 100644 --- a/FIGlet Text.novaextension/CHANGELOG.md +++ b/FIGlet Text.novaextension/CHANGELOG.md @@ -1,3 +1,6 @@ +## Version 1.13 +- added option to set how FIGcharacters are spaced + ## Version 1.12 - added option toggle margin output - added separate Comment Padding output options for block and inline comments diff --git a/FIGlet Text.novaextension/Scripts/main.js b/FIGlet Text.novaextension/Scripts/main.js index 66e6de7..e89c5c2 100644 --- a/FIGlet Text.novaextension/Scripts/main.js +++ b/FIGlet Text.novaextension/Scripts/main.js @@ -61,9 +61,10 @@ nova.commands.register('figlet', (workspace, figletArgs, textToConvert, postConv // FIGlet convert the selected text in the editor nova.commands.register('figletTextEditor', editor => { let figConfig = { - outputWidth: '-w' + nova.config.get('figlet_text.outputWidth', 'number'), - textDirection: nova.config.get('figlet_text.textDirection', 'string'), - justification: nova.config.get('figlet_text.justification', 'string'), + outputWidth: '-w' + nova.config.get('figlet_text.outputWidth', 'number'), + charSpacing: nova.config.get('figlet_text.charSpacing', 'string'), + textDirection: nova.config.get('figlet_text.textDirection', 'string'), + justification: nova.config.get('figlet_text.justification', 'string') } let bordersEnabled = nova.config.get('figlet_text.borders', 'boolean') @@ -199,7 +200,7 @@ nova.commands.register('figletTextEditor', editor => { switch (border) { case 'left': figletTextArr = figletTextArr.map(line => { - if (!/^\s+$/.test(line)) { return `${borders[border].char.repeat(borders[border].width)}${line}` } + if (!/^\s+$/.test(line)) return `${borders[border].char.repeat(borders[border].width)}${line}` }) break case 'right': diff --git a/FIGlet Text.novaextension/extension.json b/FIGlet Text.novaextension/extension.json index d415917..6f31973 100644 --- a/FIGlet Text.novaextension/extension.json +++ b/FIGlet Text.novaextension/extension.json @@ -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.12", + "version": "1.13", "categories": ["commands", "formatters"], "entitlements": { @@ -485,6 +485,16 @@ "type": "number", "default": 160 }, + { + "key": "figlet_text.charSpacing", + "title": "Character Spacing", + "description": "These options control how FIGlet spaces the FIGcharacters that it outputs. These options may or may not affect the character output depending on your font selection.", + "link": "http://www.figlet.org/figlet-man.html", + "type": "enum", + "radio": false, + "values": [["-s", "Default (-s)"], ["-S", "Smushing (-S)"], ["-k", "Kerning (-k)"], ["-W", "Full Width (-W)"]], + "default": "-s" + }, { "key": "figlet_text.textDirection", "title": "Text Direction", @@ -492,7 +502,7 @@ "link": "http://www.figlet.org/figlet-man.html", "type": "enum", "radio": false, - "values": [["-X", "Auto"], ["-L", "Left-to-right"], ["-R", "Right-to-left"]], + "values": [["-X", "Auto (-X)"], ["-L", "Left-to-right (-L)"], ["-R", "Right-to-left (-R)"]], "default": "-X" }, { @@ -502,7 +512,7 @@ "link": "http://www.figlet.org/figlet-man.html", "type": "enum", "radio": false, - "values": [["-x", "Auto"], ["-l", "Left"], ["-c", "Center"], ["-r", "Right"]], + "values": [["-x", "Auto (-x)"], ["-l", "Left (-l)"], ["-c", "Center (-c)"], ["-r", "Right (-r)"]], "default": "-x" } ]