File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -889,7 +889,12 @@ In Insert state, insert a newline and indent."
889
889
(evil-ensure-column
890
890
(move-to-window-line
891
891
(max (or count 0)
892
- (if (= (point-min) (window-start)) 0 scroll-margin)))))
892
+ (if (or (zerop scroll-margin)
893
+ (= (point-min) (window-start))
894
+ (< (count-screen-lines (window-start) (point))
895
+ scroll-margin))
896
+ 0
897
+ scroll-margin)))))
893
898
894
899
(evil-define-motion evil-window-middle ()
895
900
"Move the cursor to the middle line in the window."
@@ -902,7 +907,13 @@ In Insert state, insert a newline and indent."
902
907
:jump t
903
908
:type line
904
909
(evil-ensure-column
905
- (move-to-window-line (- (max (or count 1) (1+ scroll-margin))))))
910
+ (move-to-window-line
911
+ (- (max (or count 1)
912
+ (if (or (zerop scroll-margin)
913
+ (< (count-screen-lines (point) (window-end))
914
+ scroll-margin))
915
+ 1
916
+ (1+ scroll-margin)))))))
906
917
907
918
;; scrolling
908
919
(evil-define-command evil-scroll-line-up (count)
You can’t perform that action at this time.
0 commit comments