[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: [MD:6774] Re: [MEADOW DEVELOPMENT] Issue #MW126



ほりぐちです. すみません.

> issue MW126の更新がありましたが、これは矢木さんがmeadow-users-jp
> で報告された内容はMW126と同一で、r3817で解消済みだと言うことでよろしい
> のでしょうか? > 堀口さん

 論理行単位のスクロールについては r3817 で作り直したときに私がちょっ
と微妙と思いつつ意図していた動作です. マウスドラッグのときくらいは
表示行で移動した方がよさそうなので直します.

 非表示部分については考えていませんでしたが, 解決法があったのでマ
ウスホイールでのスクロールのほうもあわせて直します.

 とりあえず以下のパッチを mw32scroll.el にあてて試していただけます
か > 矢木さん.

-- 
ほりぐちきょうたろう

Index: mw32scroll.el
===================================================================
--- mw32scroll.el	(revision 3857)
+++ mw32scroll.el	(working copy)
@@ -83,7 +83,11 @@
 		   (+ buffer-epoch
 		      (* upper-ratio
 			 (- (car (nth 2 start-position)) scrollbar-epoch))))))
-	       (set-window-start window (line-beginning-position))
+
+	       ;; move to beginning of display-line in visible portion
+	       (vertical-motion 0)
+	       (set-window-start window (point))
+
 	       (setq pos (compute-motion (window-start) '(0 . 0)
 					 (point-max)
 					 (cons col line)
@@ -131,35 +135,11 @@
   "Neglecting point, scroll current window.
 If the point is out of the window, the point is moved to the
 center of the window."
-  (if (>= line 0)
-      (let* ((winstpoint (window-start))
-	     (position (compute-motion winstpoint '(0 . 0)
-				       (point-max) (cons 0 line)
-				       (window-width) (cons (window-hscroll) 0)
-				       (selected-window))))
-	(set-window-start (selected-window) (car position)))
+  (save-excursion
+    (goto-char (window-start))
+    (vertical-motion line)
+    (set-window-start (selected-window) (point))))
 
-    (save-excursion
-      (let ((winst1point (window-start))
-	    winst2point
-	    position1
-	    position2
-	    finline-2)
-	(goto-char (window-start))
-	(forward-line line)
-	(beginning-of-line)
-	(setq winst2point (point))
-	(setq position1 (compute-motion winst2point '(0 . 0)
-					winst1point (cons 0 (- line))
-				       (window-width) (cons (window-hscroll) 0)
-				       (selected-window)))
-	(setq finline-2 (+ (nth 2 position1) line))
-	(setq position2 (compute-motion winst2point '(0 . 0)
-					winst1point (cons 0 finline-2)
-				       (window-width) (cons (window-hscroll) 0)
-				       (selected-window)))
-	(set-window-start (selected-window) (car position2))))))
-
 (defun w32-handle-scroll-bar-event (event)
   "Handle W32 scroll bar events to do normal Window style scrolling."
   (interactive "e")