branch: elpa/evil-goggles
commit 78454a7e8bd609edf0d93cb0a7f9ed576dd33546
Merge: d7876e6566 d3222f8b07
Author: Evgeni Kolev <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #24 from unhammer/count-lines-speedup
speedup: count-lines instead of substracting line-number-at-pos's
---
evil-goggles.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/evil-goggles.el b/evil-goggles.el
index 1690a0237f..fe25914c3d 100644
--- a/evil-goggles.el
+++ b/evil-goggles.el
@@ -136,7 +136,7 @@ background of 'evil-goggles-default-face, then 'region."
(numberp end)
;; don't show overlay if the region is a single char on a single line
(not (and (<= (- end beg) 1)
- (= (line-number-at-pos beg) (line-number-at-pos end))))
+ (<= (count-lines beg end) 1)))
(<= (point-min) beg end)
(>= (point-max) end beg)
(not (evil-visual-state-p))
@@ -415,7 +415,7 @@ BEG and END are the argumenets to the original functions."
(when (and (called-interactively-p 'interactive)
(evil-goggles--show-p beg end)
;; don't show goggles for single lines ("J"/"gJ" without count)
- (< 1 (- (line-number-at-pos end) (line-number-at-pos beg))))
+ (< 1 (count-lines beg end)))
(evil-goggles--show-blocking-hint beg end)))
;;; fill