1
0
mirror of https://github.com/m00natic/vlfi.git synced 2024-10-05 18:30:51 +01: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
activate compile)
"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)
(goto-char (point-min)))
ad-do-it))
@ -186,7 +186,7 @@ OP-TYPE specifies the file operation being performed over FILENAME."
(defadvice scroll-down (around vlf-scroll-down
activate compile)
"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)
(goto-char (point-max)))
ad-do-it))