summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2011-06-28 11:50:48 +0200
committerNicolas Goaziou <n.goaziou@gmail.com>2011-06-28 20:26:49 +0200
commitcc76e765092ea7374b89553d61dddd34ff4375c0 (patch)
tree8a9c898d9bb92d0a0db25e5b72733f627c90a1f6
parentc4086ad1e4579b3beae7e3a6dea1f71d9a60d879 (diff)
downloadorg-mode-cc76e765092ea7374b89553d61dddd34ff4375c0.tar.gz
org-list: fix bug with item cycling
* lisp/org-list.el (org-cycle-item-indentation): cycling back to original position deleted any additional information in the item, like a counter or a tag.
-rw-r--r--lisp/org-list.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/org-list.el b/lisp/org-list.el
index c121c06..7402f2f 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -2497,7 +2497,7 @@ Return t at each successful move."
(let* ((org-adapt-indentation nil)
(struct (org-list-struct))
(ind (org-list-get-ind (point-at-bol) struct))
- (bullet (org-list-get-bullet (point-at-bol) struct)))
+ (bullet (org-trim (buffer-substring (point-at-bol) (point-at-eol)))))
;; Accept empty items or if cycle has already started.
(when (or (eq last-command 'org-cycle-item-indentation)
(and (save-excursion
@@ -2511,7 +2511,7 @@ Return t at each successful move."
(setq this-command 'org-cycle-item-indentation)
;; When in the middle of the cycle, try to outdent first. If
;; it fails, and point is still at initial position, indent.
- ;; Else, go back to original position.
+ ;; Else, re-create it at its original position.
(if (eq last-command 'org-cycle-item-indentation)
(cond
((ignore-errors (org-list-indent-item-generic -1 t struct)))
@@ -2519,7 +2519,7 @@ Return t at each successful move."
(ignore-errors (org-list-indent-item-generic 1 t struct))))
(t (delete-region (point-at-bol) (point-at-eol))
(org-indent-to-column (car org-tab-ind-state))
- (insert (cdr org-tab-ind-state))
+ (insert (cdr org-tab-ind-state) " ")
;; Break cycle
(setq this-command 'identity)))
;; If a cycle is starting, remember indentation and bullet,