Giter Club home page Giter Club logo

Comments (5)

fnky avatar fnky commented on June 26, 2024

I think most of the performance can be won by the third solution. This is a common solution in most IDEs which also use regex-based syntax highlighting.

Not sure what you mean by the following:

Only highlight viewport, and only when changed

Is it when viewport has changed (e.g. resizing, scrolling) or upon changing the content?

from boop.

IvanMathy avatar IvanMathy commented on June 26, 2024

Is it when viewport has changed (e.g. resizing, scrolling) or upon changing the content?

Both, though I'd say the first step would be only when changing the content, on a line-per-line basis. Since it's using NSAttributedString in the background, resizing and scrill won't change anything if the whole thing already got rendered.

from boop.

fnky avatar fnky commented on June 26, 2024

Wouldn’t this mean that pasting large amount of text would be slow if it had to parse all the text to highlight it.

I can see an issue if it only highlights the text that is visible in the viewport. Scrolling and resize would not update the highlighting.

from boop.

IvanMathy avatar IvanMathy commented on June 26, 2024

Correct, first paste would be a bit slow but I think that's an ok tradeoff for a first improvement. The biggest issue right now is the slowness when typing in a large document

from boop.

IvanMathy avatar IvanMathy commented on June 26, 2024

Fixed in release 1.3.0

from boop.

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.