Giter Club home page Giter Club logo

Comments (5)

PavelTurk avatar PavelTurk commented on June 28, 2024

I was thinking about the following solution:

  1. For highlighting I do codeArea.setStyleClass(from, to, "highlighted");
  2. User makes changes in text
  3. I get event on textProperty. Using old value, new value and caret position I get information about text change.
  4. On both sides of the changed piece of text I do:
var styles = stycodeArea.getStyleAtPosition(position);
if styles contains my "highlighted" style class then 
var range = codeArea.getStyleRangeAtPosition(position)
update styles in this range ???

Is this a correct way?

from richtextfx.

Jugen avatar Jugen commented on June 28, 2024

Yes that sounds about right .....

from richtextfx.

PavelTurk avatar PavelTurk commented on June 28, 2024

@Jugen Thank you very much for your answer. Do I understand it correctly that there is no low level API for getting text changes in RichTextFX? For example, I would like to get events - text added/removed/replaced with text and positions.

from richtextfx.

Jugen avatar Jugen commented on June 28, 2024

You can use either plainTextChanges or richChanges which includes style changes.

from richtextfx.

PavelTurk avatar PavelTurk commented on June 28, 2024

@Jugen Yes, this is what I was looking for. Thank you very much for your help.

from richtextfx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.