-
-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
editor and preview out of sync when two soft line breaks are followed by includes #1624
Comments
Thank you for reaching out. The scroll positions are determined by line markers on each paragraph that exist as hidden attributes in the preview. At the moment I receive one marker per block (equivalent to a paragraph or a heading). I had a look and I can improve it in a way that if there is an include, it will place the preview where the include begins. Still, if there are multiple includes, it will not scroll to the second and third if there is no content between them. I'll make this part of the next release of the plugin. When there are multiple includes from the same file (with tags as in your example), there is currently no good way to determine wich content in the preview matches which include. How common is it in your setup that there are multiple includes in sequence? |
Unfortunately the preview positions are always off, no matter tagged includes or separate files (tested that). I am afraid, I need to see commit 42ef53d in action (as in: Plugin updates to 0.41.15). If there would be an easy way to teach the pre-processor to automatically place an
Actually for me, that is the common resp. basic setup … yet as I know to place an |
The changes are available as part of version 0.41.15 of the plugin which is currently available as a pre-release. Please let me know if you think this is an improvement, especially if you add the The pre-release of the plugin is available from GitHub releases and the IntelliJ AsciiDoc EAP repository. |
@HaLo1701 - I messed this up when trying to make it compatible with IntelliJ 2024.2. There will be an updated release shortly. Instead of the menu bar, please use the context menu. Unfortunately there is no workaround when clicking on the preview except for downgrading to a 0.41.x version. |
Follow #1636 for the updates, as that is really related to that issue. |
Hello, |
1624.zip
Observation vs. expected behaviour
Editor and preview are out of sync when navigating through the source of
mini.adoc
.Possibly related to the inclusion of tagged files, yet even without tags, the preview “goes mayhem” with included files.
I would expect the preview to jump to the first line of an included file, when the cursor reaches the actual
include::
directive (or at least in closest vicinity-st). Not just “somewhere” (micro jumps not taken into account).Steps to reproduce
I added a—not sooo—minimal example.
Please reduce the preview window so that the jumps do happen.
When I navigate with the cursor through
mini.adoc
, the “jump lines” are 5 and 6 (which is waaayyy to early, IMHO).I was able to (slightly) workaround that by adding
{empty}
after each include.This does not completely fix the issue, yet provides a little bit better navigation.
And now the “jump lines” differ on direction.
Going down, it’s …
Going up, it’s (to give it credit, the jumps seem sensible, as they more or less go “to the other extreme”) ...
And even when you remove the soft line breaks (
+
), the main jump starts with line 5.The preview syncer seems to think that line 5 is the very last line before the first included file.
Environment
Plugin Version: 0.41.14
IntelliJ Details:
IntelliJ IDEA 2024.1.2 (Ultimate Edition)
Build #IU-241.17011.79, built on May 22, 2024
Licensed to *******
Runtime version: 17.0.11+1-b1207.24 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 6.2.0-36-generic
GC: G1 Young Generation, G1 Old Generation
Memory: 3966M
Cores: 12
Registry:
ide.experimental.ui=true
Non-Bundled Plugins:
com.jetbrains.space (241.17011.48)
digital.pedda.loremIpsum (1.1)
org.jetbrains.plugins.ruby (241.17011.79)
org.asciidoctor.intellij.asciidoc (0.41.14)
com.intellij.ml.llm (241.17011.2)
com.mallowigi.colorHighlighter (18.0.0)
com.firsttimeinforever.intellij.pdf.viewer.intellij-pdf-viewer (0.15.0)
Kotlin: 241.17011.79-IJ
Current Desktop: ubuntu:GNOME
The text was updated successfully, but these errors were encountered: