Coder Social home page Coder Social logo

Add block comment support about wsedit HOT 2 CLOSED

ladyboonami avatar ladyboonami commented on July 19, 2024
Add block comment support

from wsedit.

Comments (2)

LadyBoonami avatar LadyBoonami commented on July 19, 2024

It should be fairly obvious that the current rendering strategy of mapping a line render function over the visible area does not work for this. Unlike multiline strings, multiline comments are way too common to just ignore them, so a new rendering method is needed.

Folding over the entire file, while staying true to the philosophy of "No caching means no caching bugs", is utterly impractical, since it would slow down rendering larger files to a crawl. And dear Lord, we have enough performance problems already.

So we need some way of caching rendering information, possibly in a symbol table. We can calculate the differences between two buffer states by making use of the fact that changes always occur near the focus, never at the ends. Aligning the buffer lines via prefLen should yield the point where the two buffers start to match, so only that area would need to be re-parsed every time.

This, in turn, requires a quick way to check large strings for equality, possibly by transparently integrating hashes into Buffer.

All these are sweeping changes I do not want to implement a mere week from launch, so I'll have to delay this until after release. But sooner or later, this will have to happen, since I'd consider block comments a fairly substantial feature and simply too common and important to ignore.

from wsedit.

LadyBoonami avatar LadyBoonami commented on July 19, 2024

Done (1bb07db).

from wsedit.

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.