From 266821b087057c25c5f7169d832b0bdc8b8a0aa5 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sat, 16 Aug 2014 17:47:38 +0200 Subject: Preliminary attempt to fix horizontal scroll bar dragging with bidi text. * w32term.c (w32_horizontal_scroll_bar_handle_click): In y part of emacs_event return length from si.nPage to si.nMax. * xdisp.c (set_horizontal_scroll_bar): For right-to-left text interchange start and end of thumb. * scroll-bar.el (scroll-bar-horizontal-drag-1): Use cdr of portion-whole for scrolling right-to-left text. --- lisp/scroll-bar.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lisp/scroll-bar.el') diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el index 739670cb1c9..1af70b0d631 100644 --- a/lisp/scroll-bar.el +++ b/lisp/scroll-bar.el @@ -327,8 +327,11 @@ If you click outside the slider, the window scrolls to bring the slider there." (window (nth 0 start-position)) (portion-whole (nth 2 start-position)) (unit (frame-char-width (window-frame window)))) - (set-window-hscroll - window (/ (1- (+ (car portion-whole) unit)) unit)))) + (if (eq (current-bidi-paragraph-direction) 'left-to-right) + (set-window-hscroll + window (/ (1- (+ (car portion-whole) unit)) unit)) + (set-window-hscroll + window (/ (1- (+ (cdr portion-whole) unit)) unit))))) (defun scroll-bar-horizontal-drag (event) "Scroll the window horizontally by dragging the scroll bar slider. -- cgit v1.2.3