obsidian-meta-bind-plugin icon indicating copy to clipboard operation
obsidian-meta-bind-plugin copied to clipboard

Replace Self not working after templater conversion

Open SandmansDreams opened this issue 1 year ago • 5 comments

Please fill out these Check-boxes

  • [X] I checked for existing similar issues
  • [X] I checked that the plugin is up to date
  • [X] The issue persist with all other plugins and themes disabled

Plugin Version

1.1.3

This Issue Occurs on

  • [ ] Windows
  • [ ] Linux
  • [X] macOS
  • [ ] Android
  • [ ] iOS

Debug Info

SYSTEM INFO:
	Obsidian version: v1.6.7
	Installer version: v1.4.16
	Operating system: Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000 23.6.0
	Login status: logged in
	Catalyst license: none
	Insider build toggle: off
	Live preview: on
	Base theme: dark
	Community theme: Spectrum Blue v1.0.0
	Snippets enabled: 4
	Restricted mode: off
	Plugins installed: 43
	Plugins enabled: 2
		1: Meta Bind v1.1.3
		2: Templater v2.4.1

RECOMMENDATIONS:
	Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
	Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Describe the Issue

When using a multi-action button and having the replaceself function, it only works (gets rid of the button) if the command function is run after the replaceself function. In this case it is a command for templater to replace the active templates in the file. Seems to work fine with other commands including other templater commands.

Steps to Reproduce

Run this button:

label: Templater Converter
icon: replace
hidden: false
class: ""
tooltip: Converts the template into a usable file.
id: TemplateConvert
style: destructive
actions:
  - type: replaceInNote
    fromLine: 3
    toLine: 3
    replacement: "tags:: #"
  - type: replaceInNote
    fromLine: 4
    toLine: 4
    replacement: "parent:: "
  - type: command
    command: templater-obsidian:replace-in-file-templater
  - type: replaceSelf
    replacement: ""

This button works (flipped the locations of the replaceself and templater converter):

label: Templater Converter
icon: replace
hidden: false
class: ""
tooltip: Converts the template into a usable file.
id: TemplateConvert
style: destructive
actions:
  - type: replaceInNote
    fromLine: 3
    toLine: 3
    replacement: "tags:: #"
  - type: replaceInNote
    fromLine: 4
    toLine: 4
    replacement: "parent:: "
  - type: replaceSelf
    replacement: ""
  - type: command
    command: templater-obsidian:replace-in-file-templater

Expected Behavior

The second button functions as expected. The first button does everything except the replaceself command.

SandmansDreams avatar Aug 20 '24 17:08 SandmansDreams