Open caasion opened 2 years ago
Good feature, I will take it.
['<|>' -x '|']
is ready and available in next release.
['<|' -> '<|>' -x '|']
may be later, because
Great! Now I can fully ditch Obsidian's auto-pair rules and use this. Thank you for your hard work!
1. I'm wondering how to apply this form of chain to insertion rules or more cases
Honestly, for now, I don't think this would work for insertion rules. But if you would like this functionality, you could perhaps parse it like this:
We have &abc some text abc&
and when all of this is selected and we press the delete key, instead of all the text being deleted, the brackets are deleted.
The rule would look something like this:
'&' -> '&abc' + 'abc&' -x '' + ''
A new little feature is to be able to use |
in the first or second quote to place the cursor before or after the selected text after the deletion rule has been applied.
This syntax will allow for something interesting, to be able to transform the deleted transformation into something else.
'&' -> '&abc' + 'abc&' -x '&' + '&'
This is just a suggestion and I'm not too sure if this is desired/needed from people. I think it would be pretty cool though.
Of course, you could just not allow chaining for selection insert rules.
2. a new way should be designed to decide these rules' priority.
I think they can either have the same priority (but idk if this is possible) or the first part has higher priority than the deletion part, since it is most likely that you will auto-pair before deleting it.
I do notice that I mainly use this plugin for pairing custom brackets or expressions, so do enlighten me if this would hinder the functionality of other use cases.
On a side note, you could perhaps change the arrow for selection insert to -o
to avoid confusion and to keep it more simple as more rules are added to these rules.
Hello,
I am using this plugin to work with brackets. Currently, this plugin accommodates for auto pair conversions, but lacks the feature of auto pair deletions.
In Obsidian, when you have
(|)
and you delete the first bracket, the whole pair deletes. This is the case with[]
and{}
, but not with<>
or any other custom brackets.My suggestion is that you could:
Add another rule that allows for deletion rules. I was thinking of adding
-x
to indicate what happens when you delete the character, so the rule would look like: ['<|>' -x '|'
]And furthermore, it would be nice if you could put them together to simplify things: [
'<|' -> '<|>' -x '|'
] So this one rule serve as auto pair conversion AND deletion. Meanwhile, the above rule will only serve as a deletion rule, allowing for more flexibility.