From ab9ea6f1f12c0e88123e33804d901793bbf345dd Mon Sep 17 00:00:00 2001 From: jaanonim Date: Wed, 18 Sep 2024 18:43:29 +0200 Subject: [PATCH] formatting --- src/GenerateLinks.ts | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/GenerateLinks.ts b/src/GenerateLinks.ts index 8b2bda1..530c56a 100644 --- a/src/GenerateLinks.ts +++ b/src/GenerateLinks.ts @@ -14,25 +14,23 @@ export default function GenerateLinks( suggestions.map((suggestion) => { const index = suggestions.indexOf(suggestion); if (index >= 0) { - suggestions = suggestions.slice(index, 1) + suggestions = suggestions.slice(index, 1); } - }) - return suggestions - } - + }); + return suggestions; + }; + const lines = editor.lineCount(); for (let i = 0; i < lines; i++) { const line = editor.getLine(i); - const match = [...line.matchAll(linkRegex)]; + const match = [...line.matchAll(linkRegex)]; match.forEach((match) => { - const suggestions = removeDuplicatedSuggestionsHandler(getSuggestionsFromQuery( - match[0], - true, - settings - )); + const suggestions = removeDuplicatedSuggestionsHandler( + getSuggestionsFromQuery(match[0], true, settings) + ); suggestions.forEach(async (s) => { - if (match.index === undefined) return; + if (match.index === undefined) return; editor.replaceRange( await s.toReplace(), {