[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/xeft ad2d7b259d 23/55: Don't highlight short keywords.
From: |
ELPA Syncer |
Subject: |
[elpa] externals/xeft ad2d7b259d 23/55: Don't highlight short keywords. |
Date: |
Fri, 13 Jan 2023 23:58:37 -0500 (EST) |
branch: externals/xeft
commit ad2d7b259d6e296b49b004a1510ccf821ba3db16
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>
Don't highlight short keywords.
* xeft.el (xeft--highlight-search-phrase, xeft--highlight-matched):
Add condition (> (length keyword) 1).
---
xeft.el | 34 ++++++++++++++++++----------------
1 file changed, 18 insertions(+), 16 deletions(-)
diff --git a/xeft.el b/xeft.el
index 574ac51ced..b0401f9a14 100644
--- a/xeft.el
+++ b/xeft.el
@@ -330,16 +330,17 @@ If SELECT is non-nil, select the buffer after displaying
it."
(split-string (xeft--get-search-phrase))))
(inhibit-read-only t))
(dolist (keyword keyword-list)
- (goto-char (point-min))
- (forward-line 2)
- ;; We use overlay because overlay allows face composition.
- ;; So we can have bold + underline.
- (while (search-forward keyword nil t)
- (let ((ov (make-overlay (match-beginning 0)
- (match-end 0))))
- (overlay-put ov 'face 'xeft-inline-highlight)
- (overlay-put ov 'xeft-highlight t)
- (overlay-put ov 'evaporate t))))))
+ (when (> (length keyword) 1)
+ (goto-char (point-min))
+ (forward-line 2)
+ ;; We use overlay because overlay allows face composition.
+ ;; So we can have bold + underline.
+ (while (search-forward keyword nil t)
+ (let ((ov (make-overlay (match-beginning 0)
+ (match-end 0))))
+ (overlay-put ov 'face 'xeft-inline-highlight)
+ (overlay-put ov 'xeft-highlight t)
+ (overlay-put ov 'evaporate t)))))))
(defvar xeft--ecache nil
"Cache for finding excerpt for a file.")
@@ -546,12 +547,13 @@ non-nil, display all results."
(save-excursion
;; Add highlight overlays.
(dolist (keyword keyword-list)
- (goto-char (point-min))
- (while (search-forward keyword nil t)
- (let ((ov (make-overlay (match-beginning 0)
- (match-end 0))))
- (overlay-put ov 'face 'xeft-preview-highlight)
- (overlay-put ov 'xeft-highlight t))))
+ (when (> (length keyword) 1)
+ (goto-char (point-min))
+ (while (search-forward keyword nil t)
+ (let ((ov (make-overlay (match-beginning 0)
+ (match-end 0))))
+ (overlay-put ov 'face 'xeft-preview-highlight)
+ (overlay-put ov 'xeft-highlight t)))))
;; Add cleanup hook.
(add-hook 'window-selection-change-functions
#'xeft--cleanup-highlight
- [elpa] externals/xeft f2a7dd9259 30/55: Minor layout change, (continued)
- [elpa] externals/xeft f2a7dd9259 30/55: Minor layout change, ELPA Syncer, 2023/01/13
- [elpa] externals/xeft 9532c7dd17 40/55: * README.md: Add instruction for windows., ELPA Syncer, 2023/01/13
- [elpa] externals/xeft 45d975d54d 49/55: Prepare for ELPA, ELPA Syncer, 2023/01/13
- [elpa] externals/xeft 974520af0a 43/55: * Makefile (SOEXT): Fix if condition., ELPA Syncer, 2023/01/13
- [elpa] externals/xeft 11cf93d3aa 06/55: Refactor the module, ELPA Syncer, 2023/01/13
- [elpa] externals/xeft 2b2c8e5925 09/55: Double-buffering, ELPA Syncer, 2023/01/13
- [elpa] externals/xeft 71d13999a7 13/55: Various fixes and improvements, ELPA Syncer, 2023/01/13
- [elpa] externals/xeft 6c94f7bdb4 18/55: * xeft.el (xeft-refresh): Fix to show the "create note" prompt., ELPA Syncer, 2023/01/13
- [elpa] externals/xeft a3050c1596 20/55: * xeft.el (xeft-ignore-extension): Explain the option more clearly., ELPA Syncer, 2023/01/13
- [elpa] externals/xeft 035ae7f3d0 22/55: * xeft.el: Update commentary about 'xeft-recursive'., ELPA Syncer, 2023/01/13
- [elpa] externals/xeft ad2d7b259d 23/55: Don't highlight short keywords.,
ELPA Syncer <=
- [elpa] externals/xeft 7646d9d254 24/55: * xeft-module.cc (copy_string): Remember to free string buffer., ELPA Syncer, 2023/01/13
- [elpa] externals/xeft 71febb833f 26/55: Improve latency, ELPA Syncer, 2023/01/13
- [elpa] externals/xeft 1c1b449d21 25/55: Add semicolon after macro, ELPA Syncer, 2023/01/13
- [elpa] externals/xeft 8b8c4bd37a 27/55: Improve README, ELPA Syncer, 2023/01/13
- [elpa] externals/xeft 2b515faf2e 29/55: * xeft-module.cc (copy_string): Fix free statement;, ELPA Syncer, 2023/01/13
- [elpa] externals/xeft b980aac44f 45/55: Pull xapian-lite from GitHub, ELPA Syncer, 2023/01/13
- [elpa] externals/xeft ea43335993 35/55: Extend handled query syntax and document it, ELPA Syncer, 2023/01/13
- [elpa] externals/xeft e694278a16 53/55: Improve auto-compile/download commands, ELPA Syncer, 2023/01/13
- [elpa] externals/xeft cb4b595b6a 50/55: Update gitignore, ELPA Syncer, 2023/01/13
- [elpa] externals/xeft 3a60ed7639 36/55: Provide option to download dynamic module automatically, ELPA Syncer, 2023/01/13