Browse Source

org-table: Fix checks for impossible row moves

* lisp/org-table.el (org-table-move-row): Fix checks.
Nicolas Goaziou 7 years ago
parent
commit
40e03973f3
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lisp/org-table.el

+ 3 - 1
lisp/org-table.el

@@ -1533,8 +1533,10 @@ non-nil, the one above is used."
 	 (dline2 (+ dline1 (if up -1 1)))
 	 (tonew (if up 0 2))
 	 txt hline2p)
+    (when (and up (= (point-min) (line-beginning-position)))
+      (user-error "Cannot move row further"))
     (beginning-of-line tonew)
-    (unless (org-at-table-p)
+    (when (or (and (not up) (eobp)) (not (org-at-table-p)))
       (goto-char pos)
       (user-error "Cannot move row further"))
     (setq hline2p (looking-at org-table-hline-regexp))