Closed adamalbu closed 5 months ago
I get an error whenever I press the button. Here is the code for the button:
type template action templater.testReplace templater true
Here is the template:
<%* let linestart = 0 //get file content and replace checked boxes for unchecked var noteContent = tp.file.content.replaceAll ("foo","bar"); //select all in note let cmEditorAct = this.app.workspace.activeLeaf.view.editor; cmEditorAct.setSelection({ line: 0, ch: 0 }, { line: 9999, ch: 9999 }); //replace content tR = noteContent.split("<%*")[0]; %>
Whenever I press the button, this error appears in the console:
plugin:buttons:186 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'lineStart') at eval (plugin:buttons:186:34)
Here is the line where the error is:
.splice(position.lineStart, position.lineEnd - position.lineStart)
I'm also getting this error and it appears to be new, as my button was working fine before. Any ideas how to resolve it?
Should be fixed. reopen if this is still a problem
I get an error whenever I press the button. Here is the code for the button:
Here is the template:
Whenever I press the button, this error appears in the console:
Here is the line where the error is: