mirror of
https://github.com/org-roam/org-roam
synced 2025-09-22 16:20:54 -05:00
(fix)completion: annotation fixes (#1904)
* (fix)Formatter: Ensure that strings are always padded up to the field width * (feat)Colorize tags by default with org-tag face
This commit is contained in:
@@ -37,7 +37,7 @@
|
|||||||
;;; Options
|
;;; Options
|
||||||
;;;; Completing-read
|
;;;; Completing-read
|
||||||
(defcustom org-roam-node-display-template
|
(defcustom org-roam-node-display-template
|
||||||
"${title:*} ${tags:10}"
|
(concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag))
|
||||||
"Configures display formatting for Org-roam node.
|
"Configures display formatting for Org-roam node.
|
||||||
Patterns of form \"${field-name:length}\" are interpolated based
|
Patterns of form \"${field-name:length}\" are interpolated based
|
||||||
on the current node.
|
on the current node.
|
||||||
@@ -532,11 +532,7 @@ Uses `org-roam-node-display-template' to format the entry."
|
|||||||
(- width tmpl-width))
|
(- width tmpl-width))
|
||||||
((>= (string-to-number field-width) 0)
|
((>= (string-to-number field-width) 0)
|
||||||
(string-to-number field-width))))
|
(string-to-number field-width))))
|
||||||
;; Setting the display (which would be padded out to the field length) for an
|
(when field-width
|
||||||
;; empty string results in an empty string and misalignment for candidates that
|
|
||||||
;; don't have some field. This uses the actual display string, made of spaces
|
|
||||||
;; when the field-value is "" so that we actually take up space.
|
|
||||||
(unless (or (not field-width) (equal field-value ""))
|
|
||||||
(let* ((truncated (truncate-string-to-width field-value field-width 0 ?\s))
|
(let* ((truncated (truncate-string-to-width field-value field-width 0 ?\s))
|
||||||
(tlen (length truncated))
|
(tlen (length truncated))
|
||||||
(len (length field-value)))
|
(len (length field-value)))
|
||||||
|
Reference in New Issue
Block a user