-
Notifications
You must be signed in to change notification settings - Fork 29
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
Moving the cursor on to a long line causes it to wrap #59
Comments
Yes, that's why it happens. One way to work around it is to enable truncate-line-mode. |
Is there a way to change the direction of the animation? i.e. instead of adding extra characters and highlighting their background, can we change the background of the characters before the cursor? I'm not sure how easy/difficult this would be so please feel free to shoot this down. |
It wouldn't be super hard, because the current functionality already implements the background changing, one would only need to make it go backwards. |
Would you be able to take this as an enhancement? |
I really liked the backwards beacon version, Which goes roughly as follows. (setq cemacs-beacon-size 40
cemacs-beacon-size-padding 10
)
;; FIX: A placeholder fix to prevent beacon from pushng the text around near
;; the end of lines
(defun cemacs-beacon-truncate-to-line ()
(let* ((point-along-line (- (point) (line-beginning-position)))
(buffer-width (window-width))
(point-window-end-distance (abs (- buffer-width point-along-line)))
(end-distance-padded (- point-window-end-distance
cemacs-beacon-size-padding))
)
(setq beacon-size end-distance-padded)
(when (> end-distance-padded cemacs-beacon-size)
(setq beacon-size cemacs-beacon-size)
)
(when (< end-distance-padded 0)
;; Oops, just set it to 0 and move on
(setq beacon-size 10)
(message "Failed to calculate a non-intrusive beacon-size, Refusing to blink")
)
)
)
(add-hook 'beacon-before-blink-hook 'cemacs-beacon-truncate-to-line) This is of course intended to be written in your config. I don't think its particularly robust or good but its what I'm going to be using for now. |
I'd like to make a slight ammendment to this comment. Since writing this I've since learned that it is possible to eclipse variables Probably a more robust method. |
This problem seems to be exacerbated by virtual indentation, as happens for example in org mode with org-indent-mode true. It appears that the problem is specifically in beacon--after-string-overlay, which tries to account for visual mode (and make the overlay short enough to not wrap off the screen), but the call to beacon--visual-current-column doesn't take into account the virtual indentation mentioned above. |
Let's say a line is just shorter than what can be accommodated on the screen and the cursor is at the end of the line. Then if I move off that line and back, the line appears to grow causing it to wrap and then shrink back at the end of beacon's animation.
I'm guessing this is because as a part of beacon's animation, you /add/ some extra characters on to the end of the line to highlight their background?
The text was updated successfully, but these errors were encountered: