Browse Source

org-table: Fix orgtbl-self-insert-command on white spaces

* lisp/org-table.el (orgtbl-self-insert-command): Properly overwrite
  white spaces when there is room for it.  This is on par with what
  `org-self-insert-command' does in Org tables.

Reported-by: Alex <agrambot@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107112>
Nicolas Goaziou 2 years ago
parent
commit
1d2f52f487
1 changed files with 2 additions and 4 deletions
  1. 2 4
      lisp/org-table.el

+ 2 - 4
lisp/org-table.el

@@ -4571,11 +4571,9 @@ overwritten, and the table is not marked as requiring realignment."
 		 (org-table-blank-field))
 	    t)
 	   (eq N 1)
-	   (looking-at "[^|\n]*  +|"))
+	   (looking-at "[^|\n]* \\( \\)|"))
       (let (org-table-may-need-update)
-	(goto-char (1- (match-end 0)))
-	(org-delete-backward-char 1)
-	(goto-char (match-beginning 0))
+	(delete-region (match-beginning 1) (match-end 1))
 	(self-insert-command N))
     (setq org-table-may-need-update t)
     (let* (orgtbl-mode