[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/consult 39f41ed 2/2: consult--format-location: Only app
From: |
ELPA Syncer |
Subject: |
[elpa] externals/consult 39f41ed 2/2: consult--format-location: Only append colon if STR is non-nil (Fix #460) |
Date: |
Wed, 3 Nov 2021 08:57:12 -0400 (EDT) |
branch: externals/consult
commit 39f41edda6f35f63b0cf099905b890bdc925db45
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
consult--format-location: Only append colon if STR is non-nil (Fix #460)
---
consult.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/consult.el b/consult.el
index 5e2139c..b1813f9 100644
--- a/consult.el
+++ b/consult.el
@@ -845,7 +845,7 @@ Otherwise the `default-directory' is returned."
(defun consult--format-location (file line &optional str)
"Format location string 'FILE:LINE:STR'."
(setq line (number-to-string line)
- str (concat file ":" line ":" str)
+ str (concat file ":" line (and str ":") str)
file (length file))
(put-text-property 0 file 'face 'consult-file str)
(put-text-property (1+ file) (+ 1 file (length line)) 'face
'consult-line-number str)
@@ -2649,7 +2649,7 @@ The symbol at point is added to the future history."
;; `line-number-at-pos' is slow, see comment in
`consult--mark-candidates'.
(let ((line (line-number-at-pos pos
consult-line-numbers-widen)))
(push (concat
- (propertize (consult--format-location (buffer-name
buf) line)
+ (propertize (consult--format-location (buffer-name
buf) line "")
'consult-location (cons marker line)
'consult-strip t)
(consult--line-with-cursor marker)