emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address@hidden: Cursor placement with mouse in long lines with wrapp


From: Chong Yidong
Subject: Re: address@hidden: Cursor placement with mouse in long lines with wrapped tab]
Date: Thu, 30 Nov 2006 14:06:52 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux)

>> When I try to set the cursor via mouse-1 on a long line that wraps in a tab
>> character, the placement is off by a few characters depending on the number 
>> of columns of the emacs frame.
>
> I think this is a bug in move_it_to.  When a line ends in a tab, some
> of the glyphs associated with the tab are displayed on the current
> line, and some may be displayed on the next.  In move_it_to, we call
> move_it_in_display_line_to to move to an x position, check if the
> y-position has been reached, and go to the next line if it hasn't.
> For continued lines ending in a tab, at the end of
> move_it_in_display_line_to the value of it->current_x is the x-value
> of the beginning of the final tab, and does not include those tab
> glyphs displayed on this line.  This causes the algorithm to get
> confused.
>
> I propose the following patch.  I think it shouldn't cause any harm in
> other situations, but could someone please review it?

Please consider this patch instead (it won't interfere with other
multi-glyph characters):

*** emacs/src/xdisp.c.~1.1130.~ 2006-11-26 16:47:55.000000000 -0500
--- emacs/src/xdisp.c   2006-11-30 14:03:33.000000000 -0500
***************
*** 6828,6834 ****
          break;
  
        case MOVE_LINE_CONTINUED:
!         it->continuation_lines_width += it->current_x;
          break;
  
        default:
--- 6828,6835 ----
          break;
  
        case MOVE_LINE_CONTINUED:
!         it->continuation_lines_width +=
!           (it->c == '\t') ? it->last_visible_x : it->current_x;
          break;
  
        default:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]