GithubHelp home page GithubHelp logo

Comments (9)

abo-abo avatar abo-abo commented on July 22, 2024

Sometimes, it'll highlight it all correctly, and sometimes, it'll highlight it all wrong. This is an example where part of the highlighting is wrong.

Closing as not reproducible. If you manage to reliably reproduce it, please reopen.

from avy.

PythonNut avatar PythonNut commented on July 22, 2024

@tsdh You've reproduced this, right?

from avy.

tsdh avatar tsdh commented on July 22, 2024

@PythonNut @abo-abo Yes, I can with the current avy version and emacs -Q. See the two screenshots which also contain the recipe.

screenshot from 2015-06-03 23-59-49
screenshot from 2015-06-04 00-00-04

As you can see, the overlays in the ;; preceding the lisp comment at the top of the buffer are correct, i.e., every matching char is shown in blue. This should also happen to the long semicolon sequences below but there blue and red alternate.

In contrast to @PythonNut, this is completely reproducible and deterministic here. Or wait, it depends on length of, well, I don't really know. All I can say is that THIS is displayed correctly

;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;

while THIS isn't

;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;

The difference is just that the latter has one semicolon more in the last line...

from avy.

abo-abo avatar abo-abo commented on July 22, 2024

See the two screenshots which also contain the recipe.

I'd prefer not to copy sensitive text from the screenshot. Could you just paste the whole text here?

from avy.

tsdh avatar tsdh commented on July 22, 2024

Yes, of course. Consider this test file avy-bug.el.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;

Then start emacs like so: emacs -Q -l ~/path/to/avy/avy.el --eval "(setq avy-style 'de-bruijn)" ~/avy-bug.el and do M-x avy-goto-char RET ; and you'll get the wrong highlighting.

As soon as you delete one single ; (no matter in which line) and try to jump to ; again, the highlighting is correct.

Oh, it's actually the same when you put the contents all on the same line, or break it into 10 or 20 lines, or add spaces in between, etc.. So with the avy defaults, at most 81 consecutive (with only arbitrary whitespace in between) matches work, with 82 and up it doesn't anymore.

Hm, what's 81 for a magic number? Well, by default avy-keys has the length 9, and 9^2 is 81...

from avy.

abo-abo avatar abo-abo commented on July 22, 2024

Can you check again? I think this could be fixed.

from avy.

tsdh avatar tsdh commented on July 22, 2024

No, I'm sorry, it's still wrong in the same way as explained in my last comment: 81 consecutive matching chars => everything's ok, 82 consecutive matching chars => wrong highlighting.

from avy.

abo-abo avatar abo-abo commented on July 22, 2024

The bug was caused by the assumption that overlays-in is sorted (which it was randomly). Please check if it's fixed now.

from avy.

tsdh avatar tsdh commented on July 22, 2024

Yes, it is fixed. Thanks a lot!

from avy.

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.