Skip to content
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

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

Open
duianto opened this issue Jul 8, 2021 · 2 comments
Labels

Comments

@duianto
Copy link

duianto commented Jul 8, 2021

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

  • Open a new buffer: C-x b test RET
  • Type or copy and paste:
abc
def
abc
def

With the cursor on the last word def

  • Enable ahs mode: M-x auto-highlight-symbol-mode RET
    After a second, both instances of def becomes highlighted.
  • The following steps need to be performed within a second:
    Move the cursor to the line above: up (arrow key)
    and before the instances of abc becomes highlighted,
    Try to move to the next/prev symbol: M-right or M-leftsymbol.

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
Copy link
Member

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

Thanks for reporting this issue to us!

@jcs090218 jcs090218 added the bug label Jul 9, 2021
@duianto
Copy link
Author

duianto commented Jul 9, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants