elp-revive / auto-highlight-symbol

Automatic highlighting current symbol minor mode.
GNU General Public License v3.0
52 stars 13 forks source link

ahs-forward or ahs-backward before symbol highlighted: Wrong type argument: overlayp, nil #9

Open duianto opened 3 years ago

duianto commented 3 years ago

The messages buffer shows:

ahs-select: Wrong type argument: overlayp, nil

when trying to navigate to the next/previous symbol, before the highlight has appeared.

Reproduction steps

Observed

ahs-select: Wrong type argument: overlayp, nil

Expected

The cursor should move to the next/previous symbol.

Notes

It seems like the highlight symbol timer is reset every time one tries to move to the next/prev symbol, because the error message keeps repeating when pressing: M-right or M-left within a second.

When one waits and the highlight appears, then the key bindings navigate to the next/prev symbol, as expected.

System info

auto-highlight-symbol-20210705.1351 GNU Emacs 27.2 (build 1, x86_64-w64-mingw32) of 2021-03-26 Windows 21H1

jcs090218 commented 3 years ago

Same with #11. This should be fixed in master branch. 👍

Thanks for reporting this issue to us!

duianto commented 3 years ago

There's no overlayp, nil error message any more 👍

However, nothing happens when the cursor is moved to another symbol, and one starts pressing M-right before the new symbol is highlighted.

And the highlight symbol timer seems to be reset, every time M-right is pressed, because one can keep pressing M-right and nothing keeps happening.

Ideally the current symbols instances should be highlighted when M-right is pressed, and it should navigate to the next instance.

But if needs to find all instances first, and they have to be highlighted, before it can navigate to the next instance.

Then it could be helpful to show a message that says something like: No highlighted symbol found

or, a direction specific message:

for M-right: Can't navigate to the next symbol, no highlighted symbol found

for M-left: Can't navigate to the previous symbol, no highlighted symbol found

or something better.