[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 9cf3f08 045/399: swiper.el (swiper-use-visual-line-p): New
From: |
Oleh Krehel |
Subject: |
[elpa] master 9cf3f08 045/399: swiper.el (swiper-use-visual-line-p): New variable |
Date: |
Sat, 20 Jul 2019 14:56:46 -0400 (EDT) |
branch: master
commit 9cf3f08bf90354b9d2dbdde01abf3a4b3712e772
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
swiper.el (swiper-use-visual-line-p): New variable
Fixes #1952
---
swiper.el | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/swiper.el b/swiper.el
index 5480465..15c40d9 100644
--- a/swiper.el
+++ b/swiper.el
@@ -372,6 +372,15 @@ Make sure `swiper-mc' is on `mc/cmds-to-run-once' list."
(declare-function outline-show-all "outline")
+(defvar swiper-use-visual-line-p
+ (lambda (n-lines)
+ (and visual-line-mode
+ ;; super-slow otherwise
+ (< (buffer-size) 20000)
+ (< n-lines 400)))
+ "A predicate that decides whether `line-move' or `forward-line' is used.
+Note that `line-move' can be very slow.")
+
(defun swiper--candidates (&optional numbers-width)
"Return a list of this buffer lines.
@@ -379,10 +388,7 @@ NUMBERS-WIDTH, when specified, is used for width spec of
line
numbers; replaces calculating the width from buffer line count."
(let* ((inhibit-field-text-motion t)
(n-lines (count-lines (point-min) (point-max))))
- (if (and visual-line-mode
- ;; super-slow otherwise
- (< (buffer-size) 20000)
- (< n-lines 400))
+ (if (funcall swiper-use-visual-line-p n-lines)
(progn
(when (eq major-mode 'org-mode)
(require 'outline)
- [elpa] master 2a02343 036/399: counsel.el (counsel-file-jump): Fix file expansion, (continued)
- [elpa] master 2a02343 036/399: counsel.el (counsel-file-jump): Fix file expansion, Oleh Krehel, 2019/07/20
- [elpa] master f0b2bc6 037/399: Update ivy-help.org, Oleh Krehel, 2019/07/20
- [elpa] master da9d937 041/399: ivy.el (ivy-call): Allow ivy-inhibit-action to be a function, Oleh Krehel, 2019/07/20
- [elpa] master c38daa3 039/399: Enable counsel-read-env to work in read-file-name, Oleh Krehel, 2019/07/20
- [elpa] master e88c7d6 044/399: counsel.el (counsel-locate-cmd): Simplify, Oleh Krehel, 2019/07/20
- [elpa] master 51c5874 042/399: counsel.el (counsel-find-file-map): Bind "`" to bookmarks, Oleh Krehel, 2019/07/20
- [elpa] master 3de074a 049/399: counsel.el (counsel-find-file-copy): Add and bind., Oleh Krehel, 2019/07/20
- [elpa] master a538df1 053/399: ivy.el (ivy-make-magic-action): Point doc to the action function, Oleh Krehel, 2019/07/20
- [elpa] master 84b5ece 050/399: counsel.el (counsel-find-file-copy): Use ivy-inhibit-action, Oleh Krehel, 2019/07/20
- [elpa] master 9e3c855 052/399: ivy.el (ivy-make-magic-action): Fix bug, Oleh Krehel, 2019/07/20
- [elpa] master 9cf3f08 045/399: swiper.el (swiper-use-visual-line-p): New variable,
Oleh Krehel <=
- [elpa] master 15e2c88 051/399: Restore buffer-list after counsel-switch-buffers, Oleh Krehel, 2019/07/20
- [elpa] master 80d40e4 046/399: Dynamically handle grep tool look-arounds, Oleh Krehel, 2019/07/20
- [elpa] master 0a4ad42 047/399: ivy-test.el (counsel--grep-regex): Add test for negative lookahead, Oleh Krehel, 2019/07/20
- [elpa] master 5f4e944 057/399: counsel.el: Fix finding dominating file, Oleh Krehel, 2019/07/20
- [elpa] master 3c16fa1 055/399: counsel.el (counsel-compile): Clean up, Oleh Krehel, 2019/07/20
- [elpa] master 876b4ac 059/399: counsel.el (counsel-compile): Minor cleanup, Oleh Krehel, 2019/07/20
- [elpa] master 56201b1 056/399: counsel.el: Remove cl-extra, Oleh Krehel, 2019/07/20
- [elpa] master 859e3cb 061/399: counsel.el: Clean up compile history keeping, Oleh Krehel, 2019/07/20
- [elpa] master 072f238 058/399: counsel.el: Capitalize proper noun "Git", Oleh Krehel, 2019/07/20
- [elpa] master 5f5a263 054/399: counsel.el (counsel-compile): Add, Oleh Krehel, 2019/07/20