Closed kometenstaub closed 2 years ago
That's a tough one, I originally used regular callbacks, but for some reason, the commands added with those do not show up in the quick access menu for mobile; and I honestly have no clue why this happens. Using editorCallback solved this, though you're completely right that it is useless here.
Ah, probably because they only work with editorCallback
s.
How about a middle ground? You check for Platform.isMobile https://github.com/obsidianmd/obsidian-api/blob/4583a6b8305b05139c6b1bf226ad15e50a9a5987/obsidian.d.ts#L2409 and add the command with the editorCallback to mobile, otherwise add the normal callback.
Good find and brilliant suggestion! Should be added in release 1.1.4, thank you for all the help!
Works great, thanks!
https://github.com/Fevol/obsidian-translate/blob/d1ad09643e29d7182ef4ab6e57ea3eecfacd79e7/src/main.ts#L107-L114
Currently, the pane can only be opened when there is an editor in focus. But there doesn't need to be an editor for the translation pane to be useful.