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

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 this issue Dec 15, 2023 · 9 comments

Comments

@newbie-02
Copy link

newbie-02 commented Dec 15, 2023

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 
`
@newbie-02 newbie-02 changed the title UI: characters lost / hidden / swallowed at end of line in edit window, small problem but confusing. UI: characters lost / hidden / swallowed at end of line in edit window, by the vertical slider? Small problem but confusing. Dec 16, 2023
@rahmanusta
Copy link
Member

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

@newbie-02

This comment was marked as off-topic.

@newbie-02

This comment was marked as off-topic.

@rahmanusta
Copy link
Member

Can you share some photos?

@newbie-02

This comment was marked as off-topic.

@rahmanusta
Copy link
Member

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

@newbie-02

This comment was marked as off-topic.

@newbie-02

This comment was marked as off-topic.

@smowton
Copy link

smowton commented Aug 14, 2024

In case this has not become clear in the interim, the exception posted at the top featuring the nonsensical complaint newPosition < 0: (10 < 0) indicates illegal concurrent calls to this CharsetEncoder instance by multiple threads. Looking at the source code for Buffer at https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/nio/Buffer.java#L326 we can see the test newPosition > limit | newPosition < 0 fails, where newPosition is 10, but then on constructing the failure report finds that in fact 10 is within the now-changed limit and assumes it must be negative.

As noted at https://docs.oracle.com/javase/7/docs/api/java/nio/charset/CharsetEncoder.html, instances of CharsetEncoder must not be used by multiple concurrent threads.

I found this thread because I just finished troubleshooting the same problem, and this is the only google hit for "CoderMalfunctionError" "newPosition < 0" :D

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

3 participants