feat: markdown-basics snippets: quote all lines

Previously, this snippet just inserted "> " before the selected text, which is
not very useful; particularly, when multiple paragraphs are selected, this will
only quote the first one.

Instead, we now prefix every line in the selection with "> ", so that it will
all be quoted regardless of how many paragraphs are taken.

This does also change the behavior in the case of no selected text slightly;
previously it would insert "> []" (where "[]" indicates the selection; that is,
it would put the insertion point after the quote marker). It now inserts
"[> ]" instead (that is, the same text but it's all selected) so if you start
typing you'll wind up removing the quote marker. Since using this snippet *not*
on a selection seems like a roundabout way of writing "> " this seems like an
acceptable tradeoff.
This commit is contained in:
Wolfgang Faust
2025-04-17 18:08:30 -07:00
committed by GitHub
parent 1b000ef82b
commit e9766a8d38

View File

@@ -11,7 +11,7 @@
},
"Insert quoted text": {
"prefix": "quote",
"body": "> ${1:${TM_SELECTED_TEXT}}",
"body": "${1:${TM_SELECTED_TEXT/^/> /gm}}",
"description": "Insert quoted text"
},
"Insert inline code": {