Description: While typing a formula, if you click on a visual element i.e. a fraction, the fraction is inserted in the formula in the wrong place instead of the cursor's current position. Steps to Reproduce: 1. start typing a formula 2. click on a visual element (i.e. a fraction) Actual Results: 3. The visual element you clicked is inserted at the beginning of the formula an not at the current cursor's position Expected Results: The visual element you clicked should be inserted at the current cursor's position (as it was happening prior to 24.x.x version) Reproducible: Always User Profile Reset: Yes Additional Info: Version: 24.2.1.2 (X86_64) / LibreOffice Community Build ID: 420(Build:2) CPU threads: 16; OS: Linux 6.5; UI render: default; VCL: gtk3 Locale: el-GR (en_US.UTF-8); UI: en-US Ubuntu package version: 4:24.2.1~rc2-0ubuntu0.22.04.1~lo1 Calc: threaded
Created attachment 193137 [details] Using Libre Math's visual elements destroys formula structure
Confirmed. The element insertion does not track the Visual mode cursor, and resulting node is misplaced. Version: 24.2.1.2 (X86_64) / LibreOffice Community Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win Locale: en-US (en_US); UI: en-US Calc: CL threaded You can revert to non-visual command input window. Done from Tools -> Options -> LibreOffice Math -> Settings panel. Uncheck the now default 'Enable Visual Editing'
(In reply to V Stuart Foote from comment #2) > Confirmed. The element insertion does not track the Visual mode cursor, and > resulting node is misplaced. > > Version: 24.2.1.2 (X86_64) / LibreOffice Community > Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac > CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: > win > Locale: en-US (en_US); UI: en-US > Calc: CL threaded > > You can revert to non-visual command input window. Done from Tools -> > Options -> LibreOffice Math -> Settings panel. Uncheck the now default > 'Enable Visual Editing' thank you for this workaround. I now realize that using this "visual mode" I can type inside the "visual" window, which works fine. But if I use the "latex" editor and then click on visual element then it is misplaced.
No repro in 7.6 with experimental mode turned on: Version: 7.6.5.2 (X86_64) / LibreOffice Community Build ID: 38d5f62f85355c192ef5f1dd47c5c0c0c6d6598b CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3 Locale: en-AU (en_AU.UTF-8); UI: en-US Calc: CL threaded Reproduced in 24.2.1: Version: 24.2.1.1 (X86_64) / LibreOffice Community Build ID: 359ef544e625d2ffbfced462ab37bd593ca85fa7 CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3 Locale: en-AU (en_AU.UTF-8); UI: en-US Calc: threaded So it's a regression.
As I understand it, this was done on purpose with: commit ee187f6ed7873f3ebc1f845a4384a84713be1e9c author Khaled Hosny Tue Sep 05 20:24:13 2023 +0300 committer خالد حسني Tue Sep 05 20:28:34 2023 +0200 starmath: Always insert using SmCursor when inline editing is enabled Choosing which code path based on which widget has focus is not a very good idea, and leads to unreliable UI tests as each code path inserts the text slightly differently (one code path inserts plain text then parses the whole equation again, while the other parses the new text then inserts the parsed node directly). Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156578 Khaled, any chance this could be handled better? I assume more users than us 3 will perceive this as a bug. Jumping between visual and syntax editing with the help of the Elements sidebar is to be expected, in my opinion.
Seems the cursor does not follow textual input. If you enter content in the document the elements are inserted at the cursor position. => bug
At this point I think we should flip the default back to disable visual editing. It seems to be more trouble than it is worth it without someone invested in fixing these issues. I don’t have a working LO build setup, though, so someone else has to do it.
Thanks, Khaled. Xisco, what do you think? - 2d47c824cd31294899fa24989b3d7bd4f98dcdee: Visual mode made default + option to turn it off, in which Khaled did note: "If it turns to be a disaster, we can flip the option and disable it by default." - ee187f6ed7873f3ebc1f845a4384a84713be1e9c: Always insert using SmCursor. Instead of reverting everything, we can default to Visual mode off but keep it out of experimental, and this report can stay open.
(In reply to Stéphane Guillou (stragu) from comment #8) > ... > Instead of reverting everything, we can default to Visual mode off but keep > it out of experimental, and this report can stay open. +1, reasonable to keep it graduated but not as default mode (using the new checkbox on Tools -> Options -> LO Math -> Settings). And Visual mode still needs a lot of documentation effort as for bug 159989 which until then likely will result in more avoidable issues being reported.