Giter Club home page Giter Club logo

Comments (8)

paul-lalonde avatar paul-lalonde commented on August 26, 2024

It also comes with a nifty selection rendering artifact:
image

from edwood.

paul-lalonde avatar paul-lalonde commented on August 26, 2024

And it would be difficult for me to argue that this is the correct behavior for '^'

from edwood.

rjkroege avatar rjkroege commented on August 26, 2024

Hm. I didn't get the background colours. But indeed, that's unfortunate.

from edwood.

paul-lalonde avatar paul-lalonde commented on August 26, 2024

This is unexpectedly ugly. Instead of porting the acme regexp, I used Go's builtin, and it matches up reasonably well. Until you want multiple "start of line" chars from a Reader. When you re-start, you get the "start of selection" match for ^, instead of the start of line. One solution is to find all of them, but the go regexp library offers FindReaderSubmatchIndex but not the FindAll variant.

from edwood.

paul-lalonde avatar paul-lalonde commented on August 26, 2024

How bad would it be if ^ matched not only newlines, but also start-of-range? That's the behaviour of the golang regexp, and it's bloody painful to work around. Enough that the Reader can't be told to ignore start-of-block matches on ^, which means expanding a []byte for our buffers. Augh. I have a plan for that that matches well with defragmenting the eventual data structure at least.

from edwood.

rjkroege avatar rjkroege commented on August 26, 2024

I think that it could be lived with? I think that I usually use the ^ on whole lines only so would seem fine?

from edwood.

paul-lalonde avatar paul-lalonde commented on August 26, 2024

Even more fun: acme itself is broken on $ matches. Select the middle line of

this is a
short text
to try Edit

and execute Edit x/$/a/junk/
Receive

this is ajunk
short text
to try Edit

rather than the expected

this is a
short textjunk
to try Edit

Edwood will get this right, and not match ^ and $ to start and end of range. Both will match start and end of document.

from edwood.

paul-lalonde avatar paul-lalonde commented on August 26, 2024

Fixed in 03f4790

Backwards searches remain broken.

from edwood.

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.