From 1f853ad8e63ae2b05033472a8fb50085fcd1257e Mon Sep 17 00:00:00 2001 From: Jethro Kuan Date: Mon, 9 Aug 2021 15:38:23 +0800 Subject: [PATCH] (fix)completions: use full string (#1754) When strings in org-roam-node-display-template are truncated, they are no longer searchable using completions, resulting in suprising behaviour. This change allows truncated strings to still be searched according to their original value. Closes #1728. --- org-roam-node.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/org-roam-node.el b/org-roam-node.el index 00e6fd4..011f0b2 100644 --- a/org-roam-node.el +++ b/org-roam-node.el @@ -481,12 +481,13 @@ Uses `org-roam-node-display-template' to format the entry." (if (not field-width) field-value (setq field-width (string-to-number field-width)) - (truncate-string-to-width - field-value - (if (> field-width 0) - field-width - (- width (cdr fmt))) - 0 ?\s))))))) + (propertize field-value + 'display (truncate-string-to-width + field-value + (if (> field-width 0) + field-width + (- width (cdr fmt))) + 0 ?\s)))))))) (defun org-roam-node-read--process-display-format (format) "Pre-calculate minimal widths needed by the FORMAT string."