lang/org: fix evil coupling #457

And use fix backspace not keeping tables aligned.
This commit is contained in:
Henrik Lissner 2018-03-12 12:44:44 -04:00
parent 686ce7b26e
commit d563d133ff
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 31 additions and 6 deletions

View file

@ -281,6 +281,28 @@ with `org-cycle'). Also:
;; Hooks
;;
;;;###autoload
(defun +org|delete-backward-char ()
(when (eq major-mode 'org-mode)
(org-check-before-invisible-edit 'delete-backward)
(save-match-data
(when (and (org-at-table-p)
(not (org-region-active-p))
(string-match "|" (buffer-substring (point-at-bol) (point)))
(looking-at ".*?|"))
(let ((pos (point))
(noalign (looking-at "[^|\n\r]* |"))
(c org-table-may-need-update))
(delete-char n)
(unless overwrite-mode
(skip-chars-forward "^|")
(insert " ")
(goto-char (1- pos)))
;; noalign: if there were two spaces at the end, this field
;; does not determine the width of the column.
(when noalign (setq org-table-may-need-update c)))
t))))
;;;###autoload
(defun +org|indent-maybe ()
"Indent the current item (header or item), if possible. Made for