admonitions
admonitions copied to clipboard
🐞 Strange Behavior of Callout Type Autocompletion
Check for existing bug reports before submitting.
- [X] I searched for existing Bug Reports and found no similar reports.
Expected Behavior
I type >[!
and a dropdown list of admonition types appears. I can type more characters to search/narrow down the list of types. When I press Enter (or alternatively Tab, doesn't matter to me), the currently selected one is autocompleted and my cursor is placed at the end.
Current behaviour
I type >[!
and a dropdown list of admonition types appears. I can type more characters to search as desired, but the first character I type is always kept, and then the autocompleted type is concatenated. For example, if I type >[!n
and then select the note
type, the result is >[!nnote]
(with my cursor one space after the bracket - that part is fine).
Furthermore, in this case, pressing Enter
(or left-clicking) to confirm the autocompletion doesn't work in a clean vault for some reason. That is, I can't actually autocomplete.
If I only type >[!
with no additional characters, then select a type, a newline is inserted. Like before, in a clean vault, pressing Enter
or clicking to confirm doesn't do anything.
If I type a space >[!
, then select a type, the selection menu remains open, which can cause "chaining" of the part of the admonition declaration after the part already typed (ex. note]
):
...ad nauseum
Unlike the previous two cases, pressing Enter
to confirm the autocompletion works in a clean vault, exhibiting the same behavior described here.
Reproduction
- Open any vault and file.
- If the Admonition plugin is not already installed, do so.
- Using live preview or source view mode, type
>[!
followed by: 1. some other character that is part of a valid admonition type, 2. nothing, or 3. a space. - The admonition autocomplete selection menu appears. Select one by pressing
Enter
or clicking on it. - Depending on what you did in Step 3, the behavior corresponding to the case described above occurs.
Which Operating Systems are you using?
- [ ] Android
- [ ] iPhone/iPad
- [ ] Linux
- [ ] macOS
- [X] Windows
Obsidian Version Check
v1.5.12 and v1.4.16
Plugin Version
10.2.0
Confirmation
- [X] I have disabled all other plugins and the issue still persists.
Possible solution
No response