Browse Source

org-agenda: Prevent icon from leaking on white space after TODO

* lisp/org-agenda.el (org-agenda-highlight-todo): Prevent icon from
  leaking on white space after TODO.

Reported-by: Keith David Bershatsky
Nicolas Goaziou 7 years ago
parent
commit
582fc12d0e
1 changed files with 10 additions and 5 deletions
  1. 10 5
      lisp/org-agenda.el

+ 10 - 5
lisp/org-agenda.el

@@ -6992,11 +6992,16 @@ The optional argument TYPE tells the agenda type."
 	   (list 'face (org-get-todo-face (match-string 2 x)))
 	   x)
 	  (when (match-end 1)
-	    (setq x (concat (substring x 0 (match-end 1))
-			    (format org-agenda-todo-keyword-format
-				    (match-string 2 x))
-			    (org-add-props " " (text-properties-at 0 x))
-			    (substring x (match-end 3)))))))
+	    (setq x
+		  (concat
+		   (substring x 0 (match-end 1))
+		   (format org-agenda-todo-keyword-format
+			   (match-string 2 x))
+		   ;; Remove `display' property as the icon could leak
+		   ;; on the white space.
+		   (org-add-props " " (org-plist-delete (text-properties-at 0 x)
+							'display))
+		   (substring x (match-end 3)))))))
       x)))
 
 (defsubst org-cmp-values (a b property)