obsidian-latex-suite icon indicating copy to clipboard operation
obsidian-latex-suite copied to clipboard

[BUG] Mouse selection highlights wrong text

Open 3f6a opened this issue 10 months ago • 1 comments

Write the following inline equation in Obsidian (this is just an example):

$\epsilon_{i} = \zeta_{+}U_{i}^{+} + \zeta_{-}U_{i}^{-}$

Now try to select this equation, by clicking on the right end (just before the ending $) and dragging the mouse (with the click held) to the left, until the beginning (just after the first $). Do not include the $'s in the selection. Then, you will see the following gets highlighted as the selection:

Screenshot 2023-08-26 at 01 36 46

which is wrong of course because we wanted to select the full equation, not just this portion. Apparently the concealment confuses the selection highlight logic. In fact, in reality the full equation is selected, as you can check by doing Ctrl+C and Ctrl+V somewhere, the full equation gets pasted.

So the bug is only visual, the selected "highlighted" text does not correspond to the actual selected text. I think it's related to how concealment expands those greek letters when selected.

3f6a avatar Aug 25 '23 23:08 3f6a

The issue only occurs when selecting right-to-left. If I had clicked initially on the left of the equation, and dragged right, the selection highlighted area I get is correct.

3f6a avatar Aug 25 '23 23:08 3f6a