From c8a2842e8f0cb722990b99470f61edde21dbe413 Mon Sep 17 00:00:00 2001 From: slvrstn Date: Sun, 27 Mar 2022 00:58:43 -0400 Subject: [PATCH] Factor markdown..orderedList in toggleNumberList() --- lib/commands.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/commands.js b/lib/commands.js index d6b3624..5063754 100644 --- a/lib/commands.js +++ b/lib/commands.js @@ -144,8 +144,9 @@ function toggleNumberList() { } else { var lineNums = {}; + var useOnes = vscode.workspace.getConfiguration('markdown.extension.orderedList').get('marker') == 'one'; return editorHelpers.replaceBlockSelection((text) => text.replace(AddNumbers, (match, newline, whitespace, line) => { - if (!lineNums[whitespace]) { + if (!lineNums[whitespace] || useOnes) { lineNums[whitespace] = 1 } return newline + whitespace + lineNums[whitespace]++ + ". " + line @@ -313,4 +314,4 @@ function Command(command, callback, label, description, showInCommandPalette) { this.label = label; this.description = description; this.showInCommandPalette = showInCommandPalette ? showInCommandPalette : false; -} \ No newline at end of file +}