Closed ShootingKing-AM closed 1 year ago
Have you tested that this works as intended? It should not, as
view.editor.getSelection()
only works in source mode/Live preview.
I was also surprised at first but maybe the obsidian API updated though its versions (or its window.getSelection().toString()
) . But yes tested and working.
I'd also rather keep this working as is, and add a separate option to read only the selected text.
In Viewing mode: If we don't select anything, it just reads the whole file (original behaviour). Only if we select something it will read the selected text only.
oh, I just noticed why, in my code, if there is no selection in the editor it falls back to window.getSelection()
Have you tested that this works as intended? It should not, as
view.editor.getSelection()
only works in source mode/Live preview.I'd also rather keep this working as is, and add a separate option to read only the selected text.