winterTTr / ace-jump-mode

a quick cursor jump mode for emacs
https://github.com/winterTTr/ace-jump-mode/wiki
609 stars 72 forks source link

Bug: Last character in buffer is ignored #37

Open lalopmak opened 11 years ago

lalopmak commented 11 years ago

Ace jump Version: 20130720.1153 Emacs: 24.3.1

Bug: The last character in a buffer is ignored in ace-jump-search.

Steps to duplicate:

  1. M-x ace-jump-char-mode
  2. Search for the last character in the buffer.

What should happen: Red overlay on characters including last (or, if the last character is the only one of its type in the visible window, jump directly to it)

What happens: Overlay does not include last character. Last character is not jumped to if it's the only one of its type.

Likely cause: re-search-forward in line 372 puts the pointer at the end of the search result. At that position, eobp in the line 373 returns t, triggering the until and prematurely breaking from the loop.

Deleting (eobp) does fix this problem, but it also causes crash when trying to use ace-jump-char-mode in certain types of buffers, (e.g. function/key information or magit buffers)

winterTTr commented 10 years ago

Thanks for your report and I also found the same issue here. I have to say that I forget why I add (eobp) here, but I am also very caution of removing it because I remember I do a lot of experiments for make it stable before.

I also tried to remove the eobp here, but do not see the crash. So could you try the latest version and check if removing eobp will cause crash ? If so, please provider more information for the crash ( which mode? which kind of buffer text? screenshot ? )

If you could not find crash any more, I will try to resolve this issue by removing eobp, but I need to make sure this will not trigger any potential crash. Thanks.