Skip to content

First visible editor line is sometimes hidden #4319

@Niklas123Niklas

Description

@Niklas123Niklas

Environment

TeXstudio: 4.9.1
Qt: 6.10.1
OS: Windows 11
TeX distribution: TeX Live 2025

Expected behavior

The first (topmost) visible line in the editor viewport should be fully visible and rendered normally (text baseline and highlighting not clipped), just like all other lines.

Actual behavior

The topmost visible line of the editor viewport is not shown correctly:
The line that should appear at the very top is clipped/hidden at the top edge of the editor.
In the provided screenshots, the line containing text like so $\gls{sym:force}$ can be replaced by ...
is not fully visible: its upper portion (and effectively the “top row”) is cut off.

After a small scroll, the editor shows a different situation where the line inelastic electron-neutral collisions becomes the first visible line, but the overall effect remains that the top row is not properly visible at the viewport boundary.

This looks like an off-by-one / vertical offset / wrong top padding issue in the editor rendering: the text layout is shifted upward so the first visible line intersects the viewport border and gets clipped.

This is fine:
Image
Scrolled a bit down, the top row disappears:
Image

How to reproduce

Open TeXstudio.
Open a .tex file with multiple lines and syntax highlighting enabled.
Scroll the editor so that a non-empty line becomes the very first visible line in the editor viewport.
Observe that the topmost line is clipped/partially invisible at the top edge of the editor area (the “top row” is not visible / text is cut off).
It seems the effect is at random, so not the second to last line of a long line or something like that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions