Browse Source

Agenda: Fix bug when changing lines with invisible text in prefix

Peter Westlake writes:

> One small thing, though - in the agenda TODO view, pressing "t"
> to mark the task as Done messes up the layout:
>
>  [[http://orgmode.org][Org-Mode]]:   TODO Demonstrate problem with link
>  in category
>
> (which appears as:
>
>  Org-Mode:   TODO Demonstrate problem with link in category)
>
>
> Press T on that line:
>
>  [[http://orgmode.org][Org-Mode]]: TODO Demonstrate problemDONE
>  Demonstrate problem with link in category
>
> (which appears as:
>
>  Org-Mode: TODO Demonstrate problemDONE Demonstrate problem with
>  link in category)
Carsten Dominik 15 years ago
parent
commit
0a0a9e5366
2 changed files with 5 additions and 1 deletions
  1. 3 0
      lisp/ChangeLog
  2. 2 1
      lisp/org-agenda.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-09-28  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-agenda.el (org-agenda-change-all-lines): Handle invisible
+	text in the prefix (if category is a link).
+
 	* org-latex.el (org-export-latex-preprocess): Deal properly with
 	empty lines in verse environments.
 

+ 2 - 1
lisp/org-agenda.el

@@ -6061,7 +6061,8 @@ If FORCE-TAGS is non nil, the car of it returns the new tags."
 		pl (org-get-at-bol 'prefix-length)
 		undone-face (org-get-at-bol 'undone-face)
 		done-face (org-get-at-bol 'done-face))
-	  (org-move-to-column pl)
+	  (goto-char (+ (point) pl))
+	  ;; (org-move-to-column pl)  FIXME: does the above line work correctly?
 	  (cond
 	   ((equal new "")
 	    (beginning-of-line 1)