1
0
mirror of https://github.com/m00natic/vlfi.git synced 2025-01-18 20:10:47 +00:00

Automatically scroll to adjacent batch when start or end of chunk is

visible.
This commit is contained in:
Andrey Kotlarski 2013-12-04 15:11:04 +02:00
parent 3e8098af61
commit a42247cac4

4
vlf.el
View File

@ -178,7 +178,7 @@ OP-TYPE specifies the file operation being performed over FILENAME."
(defadvice scroll-up (around vlf-scroll-up (defadvice scroll-up (around vlf-scroll-up
activate compile) activate compile)
"Slide to next batch if at end of buffer in `vlf-mode'." "Slide to next batch if at end of buffer in `vlf-mode'."
(if (and vlf-mode (eobp)) (if (and vlf-mode (pos-visible-in-window-p (point-max)))
(progn (vlf-next-batch 1) (progn (vlf-next-batch 1)
(goto-char (point-min))) (goto-char (point-min)))
ad-do-it)) ad-do-it))
@ -186,7 +186,7 @@ OP-TYPE specifies the file operation being performed over FILENAME."
(defadvice scroll-down (around vlf-scroll-down (defadvice scroll-down (around vlf-scroll-down
activate compile) activate compile)
"Slide to previous batch if at beginning of buffer in `vlf-mode'." "Slide to previous batch if at beginning of buffer in `vlf-mode'."
(if (and vlf-mode (bobp)) (if (and vlf-mode (pos-visible-in-window-p (point-min)))
(progn (vlf-prev-batch 1) (progn (vlf-prev-batch 1)
(goto-char (point-max))) (goto-char (point-max)))
ad-do-it)) ad-do-it))