Skip to content
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

Preview position is way off when editing long documents #459

Open
pmorch opened this issue Nov 28, 2019 · 15 comments
Open

Preview position is way off when editing long documents #459

pmorch opened this issue Nov 28, 2019 · 15 comments

Comments

@pmorch
Copy link

pmorch commented Nov 28, 2019

I have a 60+ page word document I converted to asciidoc. When I edit it with AsciidocFX far down in the document, the preview is sometimes correct. But often it starts out correct, and then when I edit a line in the editor, it scrolls away to somewhere different so that the line I'm editing is nowhere on the screen.

Because of this issue, AsciidocFx cannot show edit previews when editing long documents (failed on both the two long documents I've tried), and that reduces the utility of AsciidocFX substantially.

Use this gist to reproduce:

  • Open sample.adoc from the gist
  • View the "Outline"
  • Click on the "H1 - This is a new heading" heading
    • Notice that the editor goes to that heading but that preview stays at the top of the document (which is rather confusing).
  • Press arrow down, then arrow up
    • The editor returns to that header, and the preview now also shows that heading
  • Append "foobar" to that heading

Actual behavior: Notice that the preview is now somewhere completely else. The heading is nowhere in sight.

Expected behavior: I expected that the preview showed the edited heading.

See also these related issues with preview position sync: #391 #392 #383.

@rahmanusta
Copy link
Member

rahmanusta commented Mar 21, 2021

Hi, I checked the gist but I see only images. Where can I find the all asciidoc content ?

@pmorch
Copy link
Author

pmorch commented Mar 21, 2021

I have no idea what happened with this. When I clone the gist, sample.adoc is now 0 bytes. I've since left that job, and don't have the original checkout any longer. I'm pretty sure this will occur with any document with lots of images.

Feel free to close this issue if you don't want to pursue it, since I'm not at that job any longer and don't personally have this itch any longer. But I think it is/was a real issue, at least back in Nov 2019 when I filed it.

@Ayowel
Copy link
Contributor

Ayowel commented Mar 24, 2021

Still an issue, also very noticeable when browsing a document with numerous includes

@newbie-02
Copy link

newbie-02 commented Oct 27, 2023

Still an issue, also very noticeable when browsing a document with numerous includes [Ayowel]

Experience both problems in 2023 ( images and includes ) and would like it great! if that point could be improved.
A disgusting crutch is the possibility of using the search function independently available in both windows with the same term, and a disgusting dysfunction is that so achieved sync is trashed as soon as you scroll in one of the windows.

@newbie-02
Copy link

newbie-02 commented Nov 21, 2023

If I'm right in understanding ... there are 2 passes through the document, and something is calculating wrong line numbers in the second pass. E.g. I had a header sequence fail in row 79, it was warned as:

119228208 [] WARN  asciidoctor - 01_ieee_problems.adoc: line 79: section title out of sequence: expected levels 0 or 1, got level 2 

in the terminal, and a second time as:

119230999 [] WARN  asciidoctor - 01_ieee_problems.adoc: line -919: section title out of sequence: expected levels 0 or 1, got level 2 

line -919, both vanished as I corrected line 79.
Assume that's contributing to the mis-alignment between editor and preview.

reproducible: line count fails for header sequence fails in second pass increase by every active
include behind! the out of sequence header.

@newbie-02
Copy link

poor mans workaround ...

  • create your includes,
  • check them,
  • for further edits: search and replace include:: by /// include:: and get some sync between edit and preview,
  • to check / release the document in entirety: search and replace /// include:: by include::

cumbersome, but works to some degree,
definitely better would be if someone has talents to fix the line number scope problem ...

@masa300V
Copy link

I use AsciidocFX for big / long documents and my top ".adoc" files are just including sub parts.
In this situation, I found it beneficial if I have a software switch to stop synching panes of the ".adoc" editor and the preview.

@newbie-02
Copy link

I find under Settings - Editor Settings - 'Detached Preview', but can't check how it handles the synchronization between Editor and Preview as it leads to a dead end of showing a detached floating window with 'Setting' missing the button to return to 'Preview'. First impression: not yet fully mature.

@newbie-02
Copy link

We do have active development in AsciidocFX, but no programmer is taking this shortcoming seriously? IMHO it's rendering 'include' or preview useless. I'm sure it's only a little flaw ...

@rahmanusta
Copy link
Member

What exactly do you want?

@newbie-02
Copy link

A working sync between edit window and preview.
Click somewhere or scroll in edit window -> preview scrolls accordingly,
click or scroll somewhere in preview -> edit scrolls accordingly.
Acc. initial post it suffers in long documents,
acc. following in documents with images,
acc. following esp. in files with numerous includes,
in one point I saw that there is different numbering in
two passes over the document when rendering to html.

@newbie-02
Copy link

made you two testfiles to reproduce issue, rename to *.adoc ( github sucks ) and follow instructions in testfile_for_edit_preview_sync.adoc.

testfile_for_edit_preview_sync.adoc.txt
dummy.adoc.txt

@newbie-02
Copy link

from the comment on 2024-01-14:

poor mans workaround ...
....
cumbersome, but works to some degree, definitely better would be if someone has talents to fix the line number scope problem ...

It doesn't work for chapter numbering if one of the includes introduces a new chapter :-(

@newbie-02
Copy link

newbie-02 commented Mar 29, 2024

pmorch wrote:

I have a 60+ page word document I converted to asciidoc. ...
Use this gist to reproduce:

The gist seems dysfunctional, as well 'download zip' as 'clone https' brings most files zero bytes, in particular sample.adoc. As the issue isn't resolved I'd propose to repair.

@newbie-02
Copy link

catched a flavour of mis-counting line numbers,
In a document with deactivated includes and a sequence
fail in headers I get two announcements for line 1258 in
the terminal, whenever the document is re-rendered.
Activating an include before! the fail keeps line numbers
and still comments line 1258 two times, activating an include
behind! the fail makes one complaint about line 1258, and a
second one wrongly counting it as line 1225.

13654964 [] INFO  asciidoctor - possible invalid reference: gnu01 
13654965 [] INFO  asciidoctor - possible invalid reference: pyt03 
13655054 [] INFO  c.k.e.AsciidocAsciidoctorjConverter - Converted Asciidoc to HTML5 
13655324 [] WARN  asciidoctor - 04_ieee_854_arith.adoc: line 1258: section title out of sequence: expected level 2, got level 3 
13655468 [] INFO  asciidoctor - possible invalid reference: ica00 
13655472 [] INFO  asciidoctor - possible invalid reference: sam01 
... 
13655732 [] INFO  asciidoctor - possible invalid reference: gnu01 
13655733 [] INFO  asciidoctor - possible invalid reference: pyt03 
13656021 [] WARN  asciidoctor - 04_ieee_854_arith.adoc: line 1258: section title out of sequence: expected level 2, got level 3 
13656119 [] INFO  asciidoctor - possible invalid reference: ica00 
13656126 [] INFO  asciidoctor - possible invalid reference: sam01 


after activating an include before line 1258 produces fail list with the same line numbering, 
 
activating an include behind! line 1258 produces different output:  
  
  
33314048 [] INFO  asciidoctor - possible invalid reference: gnu01 
33314053 [] INFO  asciidoctor - possible invalid reference: pyt03 
33314229 [] INFO  c.k.e.AsciidocAsciidoctorjConverter - Converted Asciidoc to HTML5 
33314596 [] WARN  asciidoctor - 04_ieee_854_arith.adoc: line 1258: section title out of sequence: expected level 2, got level 3 
33314694 [] INFO  asciidoctor - possible invalid reference: ica00 
33314696 [] INFO  asciidoctor - possible invalid reference: sam01 
...   
33315586 [] INFO  asciidoctor - possible invalid reference: gnu01 
33315590 [] INFO  asciidoctor - possible invalid reference: pyt03 
33316085 [] WARN  asciidoctor - 04_ieee_854_arith.adoc: line 1225: section title out of sequence: expected level 2, got level 3 
33316213 [] INFO  asciidoctor - possible invalid reference: ica00 
33316216 [] INFO  asciidoctor - possible invalid reference: sam01 

in the assumed second run line 1258 is counted as 1225. An indication that something in counting is out of order, which - IMHO -
might contribute to mis-aligning between edit and preview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants