Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/snippets/snippets_insert.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def compute_snippet_body_with_substitutions(
body = snippet.body
if substitutions:
for k, v in substitutions.items():
v = v.replace("$", r"\$")
reg = re.compile(rf"\${k}|\$\{{{k}\}}")
if not reg.search(body):
raise ValueError(
Expand Down
2 changes: 1 addition & 1 deletion core/snippets/snippets_insert_raw_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def format_tabs(text: str) -> str:
spaces_per_tab: int = settings.get("user.snippet_raw_text_spaces_per_tab")
if spaces_per_tab < 0:
return text
return re.sub(r"\t", " " * spaces_per_tab, text)
return text.replace("\t", " " * spaces_per_tab)


def parse_snippet(body: str):
Expand Down