Fix scrolling in hexl-mode when ruler-mode is on

* lisp/hexl.el (hexl-scroll-down):
(hexl-scroll-up): Take ruler-mode into account when computing the
number of lines (bug#7031).  These commands would previously jump
one line too many by default, skipping one line.
This commit is contained in:
Lars Ingebrigtsen 2020-12-08 17:48:40 +01:00
parent 26b198cef9
commit 3440bd0d53

View file

@ -722,7 +722,9 @@ With prefix arg N, puts point N bytes of the way from the true beginning."
"Scroll hexl buffer window upward ARG lines; or near full window if no ARG."
(interactive "P")
(setq arg (if (null arg)
(1- (window-height))
(- (window-height)
1
(if ruler-mode 1 0))
(prefix-numeric-value arg)))
(hexl-scroll-up (- arg)))
@ -731,7 +733,9 @@ With prefix arg N, puts point N bytes of the way from the true beginning."
If there's no byte at the target address, move to the first or last line."
(interactive "P")
(setq arg (if (null arg)
(1- (window-height))
(- (window-height)
1
(if ruler-mode 1 0))
(prefix-numeric-value arg)))
(let* ((movement (* arg 16))
(address (hexl-current-address))