Comments (1)
The problem is most likely in this section of code:
public void accept( ListModification<? extends Paragraph<PS, SEG, S>> lm )
{
if ( lm.getAddedSize() > 0 ) Platform.runLater( () ->
{
int paragraph = Math.min( area.firstVisibleParToAllParIndex() + lm.getFrom(), area.getParagraphs().size()-1 );
String text = area.getText( paragraph, 0, paragraph, area.getParagraphLength( paragraph ) );
if ( paragraph != prevParagraph || text.length() != prevTextLength )
{
if ( paragraph < area.getParagraphs().size()-1 )
{
int startPos = area.getAbsolutePosition( paragraph, 0 );
area.setStyleSpans( startPos, computeStyles.apply( text ) );
}
prevTextLength = text.length();
prevParagraph = paragraph;
}
});
}
I see it uses lm.getFrom()
but not lm.getTo()
? Maybe that's the problem ?
Or maybe it has something to do with the line: "if ( paragraph != prevParagraph || text.length() != prevTextLength )" ?
Or possibly something else ?
If you can improve the code a PR will be welcome :-)
from richtextfx.
Related Issues (20)
- Cannot copy long text to clipboard HOT 3
- Q: Any missing APIs in JavaFX which are needed for this project? HOT 16
- wrapTextProperty() is temporarily ignored when inserting characters on a long line HOT 3
- Support entirely RTL documents HOT 25
- Execution failed for task ':richtextfx-demos:configJavafxRun'. HOT 2
- Update the Copyright Year in LICENSE file HOT 1
- 关于图文编辑jvm崩溃的问题 HOT 5
- Is this project even usable with a modern JDK and modular JavaFX? HOT 3
- Question: setStyle() is not reflected in paragraph.styledSegments until there is more than 1 paragraph. HOT 1
- Q: does styling without providing the index range work? HOT 2
- Any efficient way to setStyle for multiple positions? HOT 2
- Question regarding nodeFactory - custom Node implementation instead of TextExt HOT 5
- How to avoid setStyleSpans being an action for undo? HOT 2
- choose ColorPicker update codearea text color HOT 1
- \r and \r\n HOT 1
- Question: When I call the codeArea.replaceText() method, the styling is scrambled
- RichTextDemo Fonts Don't Display Correctly HOT 2
- how can I optimize the highlight performance HOT 1
- Getting No toolkit found in intellij HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from richtextfx.