-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edit x/^/ i:// : Unexpectedly exuberant #39
Comments
And it would be difficult for me to argue that this is the correct behavior for '^' |
Hm. I didn't get the background colours. But indeed, that's unfortunate. |
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. |
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. |
I think that it could be lived with? I think that I usually use the |
Even more fun: acme itself is broken on $ matches. Select the middle line of
and execute Edit x/$/a/junk/
rather than the expected
Edwood will get this right, and not match ^ and $ to start and end of range. Both will match start and end of document. |
Fixed in 03f4790 Backwards searches remain broken. |
Middling
Edit x/^/ i:// :
inserts//
before every rune. Conceivably this is the right behaviour (is it?) but it deviates significantly from Acme.The text was updated successfully, but these errors were encountered: