branch: externals/show-font
commit 54508fc5142e4f9b335dc4d574d6836d8cd496a8
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>
Fix regression in show-font--get-attribute (when output has many families)
---
show-font.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/show-font.el b/show-font.el
index 0ccb8f1614..3ed12419d4 100644
--- a/show-font.el
+++ b/show-font.el
@@ -158,7 +158,9 @@ matched against the output of the `fc-scan' executable."
(when-let ((f (or file buffer-file-name))
(_ (string-match-p show-font-extensions-regexp f))
(output (shell-command-to-string (format "fc-scan -f \"%%{%s}\"
%s" attribute f))))
- output))
+ (if (string-match-p "," output)
+ (car (split-string output ","))
+ output)))
(defun show-font--get-installed-fonts (&optional attribute)
"Get list of font families available on the system.