jiggling text and deviations in text cursor position
Environment
- TeXstudio: This is not in 4.8.4, but in current dev
- Qt: 6.8.0
- OS: Windows(10)
- TeX distribution: miktex
Expected behavior
cursor mark should be positioned correctly, text should not move
Actual behavior
see images below, I assume that this is introduced with Qt6.8.
How to reproduce
It seems to be a random effect, difficult to reproduce. First I set the cursor at the beginning of diam near start oft the first line. Character d and the mark fit closely. Then I set cursor mark to the same word near end of the second line. The mark is about 1/3 of character width mispositioned to the left (this can be quite irritating). I select the word (ctrl+d) and deselect the word (macro with ctrl+q). Be aware of the movement of the following text (2px, character width 7px). Font used is JetBrains Mono in size 9. Maybe there's another change for fonts like I fixed in #3548.
random text used
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et
works fine on ubuntu. qt6.8.1 will come up soon.
do you still see the issue with rc2 ?
indeed, I tested with portable version after copying my .ini file: TeXstudio 4.8.5 (git 4.8.5rc2) Using Qt Version 6.8.1, compiled with Qt 6.8.1 R
Maybe you are talking about Qt6.8.2 announced for 23.01.2025?
so, you still,see the issue with txs 4.8.5rc2?
yes
I updated my msys2 to Qt6.8.1. Same issue. Let's hope for 6.8.2
I can confirm this problem. Just installed 4.8.5 with Qt 6.8.1, also Windows 10. The font is "Noto Sans Mono" at size 10.
Edit: Problem does not occur on 4.8.4 (Qt 6.7.2). Some additional data may help:
- Windows 10 22H2
- Display Resolution: 2560x1440px, 100% scale
- Noto Sans Mono was selected, version 2.014 is installed with the variable font TTF.
are the rendering settings (advanced editor) default ?
Starting txs with a new profile (and changing style to windowsvista) I see this
Are these style dependent? I see no reaseon why I should have changed these settings.
no, this is a independent
it still appears with default settings as above. More observations: When the first (column 0) character of the line is not a whitespace the missbehavour appears when you select any single character of the line. Otherwise a character in column 64 or higher (independent of the number of blanks at the beginning) has to be selected.
Changing font family to FixedSys (or some other mono fonts) helps. But it happens also with Jokerman which isn't monospaced).
have you tried Qt Rendermoder ?
- This setting solves the problem:
- This setting solves the problem:
- This solves the problem but whitespaces (leading or trailing) are no longer shown as dots or arrows (Option Show Whitespace)
What is your recommendation?
1 or 3, depending whether you need the space symbols.
For 1 , all three settings are necessary?
ad 1) I only tested the two cases where exactly one of the first two is set. I didn't check what happens when 3rd option is disabled (cache of rendered lines) in these cases. But I can test it.
I am only interested in the first two options. So, both need to be active ?
yes, both are needed.
For the three Disable ... options also the following combination works:
I didn't uncheck 3rd option at first, because this options seemed to be default (see 2nd image). But the default should be unchecked:
registerOption("Editor/Hack Disable Line Cache", &editorConfig->hackDisableLineCache, false, &pseudoDialog->checkBoxHackDisableLineCache);
Ok, this seems to be overwritten in latexeditorview.cpp:
#if defined( Q_OS_LINUX ) || defined( Q_OS_WIN )
hackDisableLineCache = true;
the work-around indicates that the font is not truly mono spaced (or not all variants of the fonts are installed and are replaced by similar fonts)
The site claims that these are mono fonts. I reinstalled all 32 fonst from the zip package. A simple document shows the issue with current msys2 build or released portable version 4.8.5 (both Qt 6.8.1), but not with installed 4.8.4 (Qt 6.7.2).
I found an interesting detail. Type a text which starts at column 0 with no whitespace and such that the line contains a math env that ends before column 64. When you mark any character before the env then all the characterters from the marked up to the character before the first $ jiggle. Right of the env jiggling happens when you mark a character in column 63 or higer.
Nothing happens when marking column 62:
Test File
\documentclass[11pt,a4paper]{article}
\begin{document}
Lorem ipsum dolor sit amet, consetetur $a$ sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
\end{document}
are the rendering settings (advanced editor) default ?
Yes, for me too. :-)
I also observed that the rendering is different. Look at the following screenshot from 4.8.5:
This is from 4.8.6:
Look at "sit amet" in the bold headline. The settings from https://github.com/texstudio-org/texstudio/issues/3900#issuecomment-2567146876 (suggestion 1) fix the jiggling text but not the strange rendering. Suggestion 3 leads to problems while selecting text, e.g. highlighting the wrong lines, showing text black on blue instead of white.
are the rendering settings (advanced editor) default ?
Yes, for me too. :-)
I also observed that the rendering is different. Look at the following screenshot from 4.8.5:
This is from 4.8.6:
Look at "sit amet" in the bold headline. The settings from #3900 (comment) (suggestion 1) fix the jiggling text but not the strange rendering. Suggestion 3 leads to problems while selecting text, e.g. highlighting the wrong lines, showing text black on blue instead of white.
also win10 ?
The issue remains with Qt6.8.2 with this setup:
I am having the same issue using: TeXstudio 4.8.6 (git 4.8.6) Using Qt Version 6.8.2, compiled with Qt 6.8.2 R on macOS 15.3.1 on Apple Silicon. I have also turned off all inline spell checking. Unfortunately, this makes editing text using TeXstudio impossible, as words can overlap when displayed in the editor despite separation by a whitespace character. Thanks.

