Closed MohamedDhiaSleimi closed 5 months ago
There are three types of function snippets available, but none provide the context object you mentioned. I think there might be some misunderstanding. Docs
Sorry i forgot and left the issue open did not mean to.
Description
context object does not work in js code
To Reproduce
example snippet does not work tried to put it in its own file to isolate the problem still did not work { trigger: ":", replacement: (context) => { const currentLine = context.editor.getLine(context.editor.getCursor().line); const currentIndentation = currentLine.match(/^\s*/)[0]; const additionalIndentation = currentIndentation + "\t"; return
:\n${additionalIndentation}$0
; }, options: "c", description: "Replaces : with : followed by a newline and one more tab than the current line's indentation" },Expected Behavior
the expected behavior of the snippet is that inside a code block by typing :\t it will create a new line with an extra indentation compared to the current line
Platform
obsidian v1.5.12 Latex Suite v1.9.3