asciidocfx / AsciidocFX

Asciidoc Editor and Toolchain written with JavaFX 21 (Build PDF, Epub, Mobi and HTML books, documents and slides)
http://www.asciidocfx.com/
Apache License 2.0
1.86k stars 297 forks source link

UI: characters lost / hidden / swallowed at end of line in edit window, by the vertical slider? Small problem but confusing. #619

Open newbie-02 opened 6 months ago

newbie-02 commented 6 months ago

I experience that at the end of some lines touching the right window border
the last character is not or only partly displayed, see attached screenshot
row 2: ... dass das deutliche (n) and near bottom in the green circle:
'Redesignin (g)'
here the hidden characters are partly visible, often they are totally off,
and in consequence the editor has to check against 'false positive typos'.

[edit] Another assumption for the source of problem:
someone forgot to account the space used for the vertical slider?
The issue isn't active for very short texts not needing a slider.
It pops up when the text exceeds the window size and AsciidocFX
adds the slider. [/edit]

Assume confusion between zero-based vs. one based counting.
Evtl. the log from terminal window attached at bottom may help in debugging.

AsciidocFx_swallowed_characters


java.nio.charset.CoderMalfunctionError: java.lang.IllegalArgumentException: newPosition < 0: (10 < 0)
        at java.base/java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:588)
        at morfologik.stemming.BufferUtils.charsToBytes(BufferUtils.java:161)
        at morfologik.speller.Speller.charSequenceToBytes(Speller.java:189)
        at morfologik.speller.Speller.isInDictionary(Speller.java:253)
        at morfologik.speller.Speller.isMisspelled(Speller.java:233)
        at com.kodedu.spell.dictionary.LanguageSpeller.isMisspelled(LanguageSpeller.java:26)
        at com.kodedu.spell.dictionary.DictionaryService.lambda$processTokens$1(DictionaryService.java:88)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:178)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)
        at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
        at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
        at com.kodedu.spell.dictionary.DictionaryService.processTokens(DictionaryService.java:103)
        at com.kodedu.controller.ApplicationController.lambda$processTokens$206(ApplicationController.java:2612)
        at com.kodedu.service.impl.ThreadServiceImpl$1.call(ThreadServiceImpl.java:53)
        at javafx.graphics@21/javafx.concurrent.Task$TaskCallable.call(Task.java:1399)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at java.base/java.lang.VirtualThread.run(VirtualThread.java:311)
Caused by: java.lang.IllegalArgumentException: newPosition < 0: (10 < 0)
        at java.base/java.nio.Buffer.createPositionException(Buffer.java:352)
        at java.base/java.nio.Buffer.position(Buffer.java:327)
        at java.base/java.nio.ByteBuffer.position(ByteBuffer.java:1551)
        at java.base/java.nio.ByteBuffer.position(ByteBuffer.java:285)
        at java.base/sun.nio.cs.UTF_8.updatePositions(UTF_8.java:83)
        at java.base/sun.nio.cs.UTF_8$Encoder.encodeArrayLoopSlow(UTF_8.java:509)
        at java.base/sun.nio.cs.UTF_8$Encoder.encodeArrayLoop(UTF_8.java:461)
        at java.base/sun.nio.cs.UTF_8$Encoder.encodeLoop(UTF_8.java:564)
        at java.base/java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:586)
        ... 25 more
30976461 [] INFO  c.k.e.AsciidocAsciidoctorjConverter - Converted Asciidoc to HTML5 
30981386 [] INFO  c.k.e.AsciidocAsciidoctorjConverter - Converted Asciidoc to HTML5 
`
rahmanusta commented 5 months ago

I'm not able to reproduce it. I would like to test if you share with me some document

newbie-02 commented 5 months ago

hello @rahmanusta, thanks for caring,

the text is simple enough to not upload, see screenshot,

I even cross-checked that it's not an effect of my 4k screen,
see second screenshot with reduced resolution,
only 'requirement' I found is the text in edit window long
enough to activate the slider, then you can pull the edit / preview
border to cover one letter at the tail of row.

asciidocfx_display_problem_01
asciidocfx_display_problem_02

newbie-02 commented 4 months ago

There is a similar situation at the right border of the preview window,
but there the left rail of the slider is 'repelling' the text, while in the edit
window it's covering / hiding one digit.

rahmanusta commented 4 months ago

Can you share some photos?

newbie-02 commented 3 months ago

Did you see the screenshots in my previous posts?
In the edit window 'blablabla blablabla blablabl' and the
trailing 'a' chopped into thirds.

rahmanusta commented 3 months ago

The issue mentioned was resolved for the editor window. However, I don’t notice the issue about preview

newbie-02 commented 3 months ago

It is a similar 'situation', not making an issue because
the other parts ( border / slider ) are repelling the text,
producing 'earlier wrap'.

If you are familiar with the code pls. have a look at #459,
it's much more important an issue, making either 'includes'
or sync between edit and preview useless. IMHO it's some
simple 'miscount', but I don't know where.

newbie-02 commented 6 days ago

The issue mentioned was resolved for the editor window.

trying 1.8.10 it seems not, see attached screenshot and the covered exclamation marks at the end of lines in edit window. AsciidocFX_characters_covered_by_slider