-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Issue with evil next line #22
Comments
I don't see this behavior in a |
Hi! I did some testing, and it appears to only be an issue when using (require 'evil)
(evil-mode)
(require 'indent-bars)
(indent-bars-mode 1) Then, insert the following into the scratch buffer, but any buffer should do.
Put your cursor at the end of |
This sounds like an "evil feature" of some kind to me (e.g. is |
Hi!
I tried setting Also, it's worth noting that this issue only occurs when moving to the next line, not the previous line. Running Since this issue doesn't occur in vanilla Emacs, I think this is an issue with |
One theory is that for some reason these contiguous newlines with the same display string (value) are being merged together, or more likely "helpfully" skipped by an evil configuration/addition/patch to See this discussion. This is the reason that indent-bars creates a brand new display string for each blank line. But despite the unique strings (with the same value), perhaps evil somehow merges these into one block for navigation? Can you navigate via Go to the first string which starts the skipped block, and |
@walseb can you try these tests? |
Hi! Sorry for the delay. I will reply to this soon. |
Hello! I tried what the Running this code snippet without
It appears to work fine, although it stops at newlines, I'm not sure if that's the default behavior or if it's a setting in I will try your other suggestions soon. |
I looked into this, and it appears the culprit is at quite a low level in Here is a test that demonstrates this: (progn
(insert "\n>>>>\n" (propertize "\n" 'display "xxxxx\n") "SHOULD NOT MOVE HERE\n<<<<")
(forward-line -2) ; at beginning of xxxxx\n line
(move-to-column 10)) ; should not move past the line If there is no display property (e.g. |
Thank you for tracking down the issue! I will submit the issue soon. |
Did this get submitted as an issue? Can you post it here? |
Hello! Sorry, I forgot to send it. I sent it just now, I will send a link to the email chain when the archives are updated tomorrow. Thank you for your patience! |
Hi! I got a reply from Eli:
Ref: https://lists.gnu.org/archive/html/bug-gnu-emacs/2023-11/msg00217.html So it won't be fixed upstream. I suppose I could fix the issue locally by patching evil-mode to not use Thoughts? |
Was afraid of that; it's not clear why display strings with new lines cannot be respected. You could patch evil mode to use a move-to-column that does so (check the newline position for a 'display, and limit the move to there). Unfortunately in order to add bars to blank lines, there is nowhere other than the newline to put the display property. So not much can be done here. |
Not much I can do about this given the odd behavior of Emacs moving to column on lines with newlines in their display properties. Options are to disable (advice-add 'line-move-to-column :around
(defalias 'my/indent-bars-prevent-passing-newline
(lambda (orig col &rest r)
(if-let ((indent-bars-mode)
(nlp (line-end-position))
(dprop (get-text-property nlp 'display))
((seq-contains-p dprop ?\n))
((> col (- nlp (point)))))
(goto-char nlp)
(apply orig col r))))) |
Thank you so much! Maybe this should be linked in a notice to evil users on the readme. |
Did you try this and did it work? |
I tried |
OK let me know, if it works for you I can link from the README. There's simply no way to display a bunch of bars on a fully blank line besides |
Hello! I tried that function just now and it works perfectly. I haven't seen any negative side effects of advising it, I will report any here if I find them. Thanks so much! |
You could exchange the
|
Didn't know that, thanks. |
Hello!
I have a strange issue when this mode is enabled, and I call
next-line
.Try putting your cursor at the very end of
foo
in the code snippet below with this mode enabled, and runnext-line
, either interactively or via M-x.For me, it jumps all the way down to
bar
. Can anyone else recreate it?I'm running the latest version available on
Melpa
, andEmacs 29
.Thanks!
The text was updated successfully, but these errors were encountered: