Add newline placeholder in Ktxt2
This commit is contained in:
@@ -67,8 +67,11 @@
|
||||
"${blockStartEnd}${source}$(if outputLocked lockedStart unlockedStart)${output}${blockStartEnd}"))))
|
||||
|
||||
// To save window space after each block editor, ¶ can be used in place of \n\n
|
||||
// and ↵ in place of \n
|
||||
(function :String applySpecialChars [:String text]
|
||||
(text.replace "¶" "\n\n"))
|
||||
(.replace
|
||||
(text.replace "¶" "\n\n")
|
||||
"↵" "\n"))
|
||||
|
||||
// Return [sourceFile outputFile]
|
||||
(function :Array<String> extractFileContents [:Stream fileStream :String->Dynamic reportError]
|
||||
|
@@ -10,9 +10,14 @@
|
||||
(defNew [&prop :ExtensionContext context])
|
||||
|
||||
(method :String insertSpecialChars [:String text]
|
||||
(if (text.endsWith "\n\n")
|
||||
(+ (text.substr 0 (- text.length 2)) "¶")
|
||||
text))
|
||||
(let [text (text.replace "\r" "")]
|
||||
(cond
|
||||
((text.endsWith "\n\n")
|
||||
(+ (substr text 0 -2) "¶"))
|
||||
((text.endsWith "\n")
|
||||
(+ (substr text 0 -1) "↵"))
|
||||
(true
|
||||
text))))
|
||||
|
||||
(method :Promise<Void> resolveCustomTextEditor [:TextDocument document :WebviewPanel webviewPanel :CancellationToken _token]
|
||||
(set webviewPanel.webview.options (object enableScripts true))
|
||||
|
Reference in New Issue
Block a user