Avoid infinite loops in overlays
Handle infinite loops. This fixes #68 and also an issue where evilem-motion-previous-line is getting stuck on the Dired header for me. Going to be testing this for some time.
@PythonNut Hey, what do you think about this change?
Hi @LemonBreezes, to be honest the changes are pretty complex so haven't been able to convince myself they are correct. I'd at least like to understand how it works before I merge it, since I'll be responsible for maintaining it afterwards. Unfortunately I've been quite busy so I haven't had the time to really sit down and work everything out. I appreciate the time you spent coming up with this! I don't think I'd have the time to fix the original issue myself either.
Hi @LemonBreezes, to be honest the changes are pretty complex so haven't been able to convince myself they are correct. I'd at least like to understand how it works before I merge it, since I'll be responsible for maintaining it afterwards. Unfortunately I've been quite busy so I haven't had the time to really sit down and work everything out. I appreciate the time you spent coming up with this! I don't think I'd have the time to fix the original issue myself either.
First of all, I am using Emacs31 and Doom Emacs.
Ok. Now lemme explain. The problem is that the Dired headerline is an overlay and when I use evilem-motion-previous-line in Dired that command gets stuck in an infinite loop on the headerline because inside of this loop
We basically end up in an infinite loop between the point after the overlay and the overlay itself:
So I wanted to have some logic to detect if we are getting stuck in an overlay basically.
I am using doom emacs with emacs 31, I can confirm this commit solved the problem of searching backward, e.g. evilem-motion-backward-word-begin, evilem-motion-previous-line in dired buffer.