[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/helm 2f89214b0b 2/2: Make optional linum storing in helm-s
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/helm 2f89214b0b 2/2: Make optional linum storing in helm-source-in-file |
Date: |
Sat, 19 Mar 2022 05:58:21 -0400 (EDT) |
branch: elpa/helm
commit 2f89214b0b387f21f3a5753539ab7460559c6f17
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>
Make optional linum storing in helm-source-in-file
lines numbers are now stored only when new :linum slot is provided
with a non nil value.
---
helm-source.el | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/helm-source.el b/helm-source.el
index 77214f1e2a..1909ee2faa 100644
--- a/helm-source.el
+++ b/helm-source.el
@@ -904,12 +904,13 @@ See `helm-candidates-in-buffer' for more infos.")
(with-current-buffer (helm-candidate-buffer 'global)
(insert-file-contents file)
(goto-char (point-min))
- (while (not (eobp))
- (add-text-properties
- (point-at-bol) (point-at-eol)
- `(helm-linum ,count))
- (cl-incf count)
- (forward-line 1))))))
+ (when (helm-get-attr 'linum)
+ (while (not (eobp))
+ (add-text-properties
+ (point-at-bol) (point-at-eol)
+ `(helm-linum ,count))
+ (cl-incf count)
+ (forward-line 1)))))))
(get-line :initform #'buffer-substring)
(candidates-file
:initarg :candidates-file
@@ -918,7 +919,13 @@ See `helm-candidates-in-buffer' for more infos.")
:documentation
" A filename.
Each line number of FILE is accessible with helm-linum property
- from candidate display part."))
+ from candidate display part.")
+ (linum
+ :initarg :linum
+ :initform nil
+ :documentation
+ " Store line number in each candidate when non nil.
+ Line number is stored in `helm-linum' text property."))
"The contents of the FILE will be used as candidates in buffer.")