浏览代码

Make Org work better with visual line mode

Patch by Rudi Schlatte
Carsten Dominik 16 年之前
父节点
当前提交
84c3b6f19b
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. 7 4
      lisp/org.el

+ 7 - 4
lisp/org.el

@@ -15975,7 +15975,9 @@ beyond the end of the headline."
 		     (car org-special-ctrl-a/e)
 		   org-special-ctrl-a/e))
 	refpos)
-    (beginning-of-line 1)
+    (if (org-bound-and-true-p line-move-visual)
+	(beginning-of-visual-line 1)
+      (beginning-of-line 1))
     (if (and arg (fboundp 'move-beginning-of-line))
 	(call-interactively 'move-beginning-of-line)
       (if (bobp)
@@ -16024,9 +16026,10 @@ beyond the end of the headline."
     (if (or (not special)
 	    (not (org-on-heading-p))
 	    arg)
-	(call-interactively (if (fboundp 'move-end-of-line)
-				'move-end-of-line
-			      'end-of-line))
+	(call-interactively
+	 (cond ((org-bound-and-true-p line-move-visual) 'end-of-visual-line)
+	       ((fboundp 'move-end-of-line) 'move-end-of-line)
+	       (t 'end-of-line)))
       (let ((pos (point)))
 	(beginning-of-line 1)
 	(if (looking-at (org-re ".*?\\([ \t]*\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$"))