asciidoctor-intellij-plugin icon indicating copy to clipboard operation
asciidoctor-intellij-plugin copied to clipboard

Preview jumps to top of page while writing

Open haslingerm opened this issue 10 months ago • 4 comments

Observed vs. expected behavior

Since a few months, while writing a longer document the preview regularly 'jumps' (scrolls) to the top (title of the page) and stays there until I manually go back to the section I'm currently editing (e.g. by clicking the link in the toc). When i continue writing it also won't jump back to the currently edited section, but stay at the top.

Something similar also happens while only scrolling through a long document and then moving focus to a different window. When I get back to IntelliJ the preview more often than not jumps to the top of the page and I have to find the previous location again manually.

I thought it must be something on my end, but today one of my students asked me if I had found a solution for the problem because it happens to him as well => this prompted me to open the issue.

Steps to reproduce

It is not happening consistently, sometimes all the time, then not for a few minutes. I recorded some typing in a sample document and managed to capture the behaviour twice at timestamps 00:11 & 01:12

https://github.com/user-attachments/assets/6fbd0a92-72b1-4e97-b081-cf26185687c9

I'm typically using these settings together with source code snippets and plantuml diagrams (rendered via Kroki):

:icons: font
:nofooter:
:source-highlighter: highlight.js
:sectnums:
:toc:

Environment

This is happening for me on both my machines and in all JB IDEs (not just IntelliJ, it's the same in Rider for example). I can't remember exactly when it started, sometime in fall 2024. Both my machines run Fedora 41 with KDE Plasma and various JB IDEs, one is a workstation, the other a laptop.

Plugin Version: 0.43.6

IntelliJ Details: IntelliJ IDEA 2024.3.1.1 (Ultimate Edition) Build #IU-243.22562.218, built on December 18, 2024 Runtime version: 21.0.5+8-b631.28 amd64 (JCEF 122.1.9) VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Toolkit: sun.awt.X11.XToolkit Linux 6.12.8-200.fc41.x86_64 GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation Memory: 4002M Cores: 16 Registry: ide.experimental.ui=true i18n.locale= Non-Bundled Plugins: com.intellij.plugins.visualstudio2022keymap (243.21565.122) com.intellij.plugin.adernov.powershell (2.8.0) PlantUML integration (7.11.2-IJ2023.2) org.asciidoctor.intellij.asciidoc (0.43.6) com.github.copilot (1.5.30-242) Kotlin: 243.22562.218-IJ Current Desktop: KDE

haslingerm avatar Jan 15 '25 15:01 haslingerm

Interesting.

I'm seeing the same behaviour with our longer documents too.

https://github.com/user-attachments/assets/764613a8-afcf-4d21-8de2-6db3f6420277


IntelliJ IDEA 2025.1 Beta (Ultimate Edition) Build #IU-251.23774.16, built on March 5, 2025 Source revision: 796c901126120 Licensed to IntelliJ IDEA EAP user: Ray Offiah Expiration date: April 4, 2025 Runtime version: 21.0.6+9-b895.97 x86_64 (JCEF 122.1.9) VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Toolkit: sun.lwawt.macosx.LWCToolkit macOS 15.3.2 Kotlin plugin: K2 mode GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation Memory: 5192M Cores: 12 Metal Rendering is ON Registry: debugger.new.tool.window.layout=true ide.experimental.ui=true terminal.new.ui=true jvm.dfa.analysis.ui.security.analysis.window.was.shown=true Non-Bundled Plugins: com.jetbrains.plugins.ini4idea (251.23774.16) org.jetbrains.plugins.workspace (251.23774.16) com.intellij.plugins.watcher (251.23774.16) Batch Scripts Support (1.0.13) de.docs_as_co.intellij.plugin.diagramsnet (0.2.6) PythonCore (251.23774.16) Shifter (1.9.6) name.kropp.intellij.makefile (251.23774.16) com.c5inco.studiothemes (1.0.0) Pythonid (251.23774.16) com.intellij.aqua (251.23774.16) com.intellij.ml.llm (251.23774.32.3) com.intellij.grazie.pro (0.3.361) PlantUML integration (7.11.2-IJ2023.2) org.asciidoctor.intellij.asciidoc (0.44.2) com.github.beansoft.iscratch (2025.1 EAP 1) net.seesharpsoft.intellij.plugins.csv (4.0.2) com.nasller.CodeGlancePro (1.9.7) com.virtuslab.git-machete (6.0.0) izhangzhihao.rainbow.brackets (2024.2.9-241) com.dmarcotte.handlebars (251.23774.16) com.intellij.plugins.html.instantEditing (251.23774.16) Kotlin: 251.23774.16-IJ

RayOffiah avatar Mar 13 '25 10:03 RayOffiah

Mmmm, and when clicking on a link with an anchor ID, it always seems to go to the anchor, then quickly jump back to the top of the page.

RayOffiah avatar Mar 13 '25 11:03 RayOffiah

Hey all,

Just to add that I see this too - but the opposite: the preview scrolls to the bottom of the page. Like the others above, it doesn't happen on every file.

However, my setup is a different. I use basic delegate files that include the source files. (So I can add variables etc. for reuse.)

  • When I edit the source, behaviour is normal.

  • When I edit the delegate file, the preview scrolls to the bottom of the page. I have to scroll up manually or click on the top (empty) line of the delegate file, then it scrolls back up. On long files this makes me seasick ;)

NOTE: I start all files with several empty lines to avoid the PyCharm browser button bar hovering over my text. In fact, I should try disabling that and removing the empty lines. But empty lines shouldn't be forcing scrolling, no?

Environment

Plugin Version: 0.44.7

IntelliJ Details:

PyCharm 2025.1.3 Build #PY-251.26927.74, built on July 1, 2025 Source revision: a83aaf71e7d3d Runtime version: 21.0.7+9-b895.130 amd64 (JCEF 122.1.9) VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Toolkit: sun.awt.windows.WToolkit Windows 11.0 GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation Memory: 2048M Cores: 20 Registry: ide.experimental.ui=true Non-Bundled Plugins: PlantUML integration (7.12.1-IJ2023.2) org.asciidoctor.intellij.asciidoc (0.44.7)

dyw-dyw avatar Jul 17 '25 15:07 dyw-dyw

I can confirm, that I also see this behavior. In my case I have multiple partial .adoc files under src/ and a central entry point .adoc in the repository root folder. I am opening the preview for the entrypoint file on the right and then edit the individual files in the source subfolder on the left. I am not using the built-in split feature, but I split via IntellIj tabs and then use Show Editor Only and Show Preview Only in the respective tabs.

It appears that the bug triggers:

a) when I make changes to the partial source b) when I click into the preview tab and then click into the source tab

It does not trigger if I just scroll in the preview tab and then reposition the cursor in the source tab with a click.

s-geiger-si avatar Sep 05 '25 07:09 s-geiger-si