about summary refs log tree commit diff
path: root/tools/emacs-pkgs/notable/notable.el
diff options
context:
space:
mode:
Diffstat (limited to 'tools/emacs-pkgs/notable/notable.el')
-rw-r--r--tools/emacs-pkgs/notable/notable.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/emacs-pkgs/notable/notable.el b/tools/emacs-pkgs/notable/notable.el
index ba59a1ee2b22..4668dd333c99 100644
--- a/tools/emacs-pkgs/notable/notable.el
+++ b/tools/emacs-pkgs/notable/notable.el
@@ -204,10 +204,14 @@
   (check-type id integer)
   (check-type note notable--note)
 
-  (let ((start (point))
-        (first-line (car (s-lines (notable--note-content note))))
-        (date (dottime-format (seconds-to-time
-                               (notable--note-time note)))))
+  (let* ((start (point))
+         (date (dottime-format (seconds-to-time
+                                (notable--note-time note))))
+         (first-line (truncate-string-to-width
+                      (car (s-lines (notable--note-content note)))
+                      ;; Length of the window, minus the date prefix:
+                      (- (window-width) (+ 2 (length date)))
+                      nil nil 1)))
     (insert (propertize (s-concat date "  " first-line)
                         'notable-note-id id))
     (insert "\n")))