summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2011-02-25 20:48:27 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2011-02-25 20:48:27 +0100
commit7b211c86e73bd6d71527091eb10dd258b8373547 (patch)
tree06e3234fdacf734f9fb6dca862081f1c94fcc476
parent97de64cfc3a9b177a8129f500d73a673bd8e11d7 (diff)
downloadorg-mode-7b211c86e73bd6d71527091eb10dd258b8373547.tar.gz
org-list: fix insertion of item with indent-tabs-mode is non-nil
* lisp/org-list.el (org-list-insert-item): when computing size of item being inserted, function has to take into account that indentation may not only be made of spaces.
-rw-r--r--lisp/org-list.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/org-list.el b/lisp/org-list.el
index 1449062..8160fcc 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -1172,7 +1172,10 @@ This function modifies STRUCT."
;; BEFOREP and SPLIT-LINE-P. The difference of size
;; between what was cut and what was inserted in buffer
;; is stored in SIZE-OFFSET.
- (ind (org-list-get-ind item struct))
+ (ind (let ((ind-ref (org-list-get-ind item struct)))
+ (if (not indent-tabs-mode)
+ ind-ref
+ (+ (/ ind-ref tab-width) (mod ind-ref tab-width)))))
(bullet (org-list-bullet-string (org-list-get-bullet item struct)))
(box (when checkbox "[ ]"))
(text-cut