GNU bug report logs - #29002
it.first_visible_x is erroneously 0 while horizontal scrolling.

Previous Next

Package: emacs;

Reported by: Keith David Bershatsky <esq <at> lawlist.com>

Date: Thu, 26 Oct 2017 01:04:02 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Keith David Bershatsky <esq <at> lawlist.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 29002 <at> debbugs.gnu.org
Subject: bug#29002: it.first_visible_x is erroneously 0 while horizontal	scrolling.
Date: Wed, 25 Oct 2017 23:20:09 -0700
Thank you, Eli, for looking at #29002.

In the screen-shot, line 4 is the current-line and it is hscrolled.

• hscrolling_current_line_p is true.

• w->suspend_auto_hscroll is false.

• w->hscroll > 0.

• All non-current lines are also hscrolled.

• it.first_visible_x == 0.

What would be a good method to programmatically test to see whether all other lines are hscrolled given the above?

As I visit each screen line from top to bottom of the window, I will need to determine whether the line is hscrolled and then try make my way over to a screen relative X coordinate.  move_it_in_display_line_to will need an absolute X.

For example, let's say we are on line 6 in the screen-shot.  How do we know that it is hscrolled?  If we know for sure it is hscrolled, then we can tell move_it_in_display_line_to try and reach (w->hscroll * FRAME_COLUMN_WIDTH (f)) + my_arbitrary_screen_relative_x.

Keith

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

DATE:  [10-25-2017 21:51:55] <26 Oct 2017 07:51:55 +0300>
FROM:  Eli Zaretskii <eliz <at> gnu.org>
> 
>  * * *
> 
> I'm not sure why you expected non-zero values in this case, but if you
> want to identify this situation, use the function
> hscrolling_current_line_p.  Or just calculate the value yourself
> using w->hscroll.




This bug report was last modified 7 years and 291 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.