Switch to parse only single quotes by default + make quote command smart enough to escape captured quotemarks

This commit is contained in:
2026-03-02 23:31:38 -06:00
parent bd3453c9b0
commit 1278a2a846
2 changed files with 4 additions and 2 deletions

View File

@@ -46,6 +46,7 @@ export class Quote extends Command<{ with?: StrTerm }> {
}
sub = stripQuotemarkLayer(sub)
sub = sub.replaceAll(quote, `\\${quote}`)
return `${quote}${sub}${quote}`
}
}))

View File

@@ -87,8 +87,9 @@ export class Lexer extends BehaviorSubject<LexToken> {
continue
}
// We are either starting or ending an unescaped matching quote
if ( c === `'` || c === `"` ) {
// We are either starting or ending an unescaped matching quote.
// For now, only parse single quotes. Makes it nicer to type " in commands.
if ( c === `'` ) {
if ( c === this.inQuote ) {
this.inQuote = undefined
await this.emitToken('quote', true)