GNU bug report logs - #40849
26.3; count-screen-lines returns incorrect result when truncated lines are counted

Previous Next

Package: emacs;

Reported by: Alexander Miller <alexanderm <at> web.de>

Date: Sat, 25 Apr 2020 13:46:02 UTC

Severity: normal

Found in version 26.3

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

Bug is archived. No further changes may be made.

Full log


Message #10 received at 40849-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alexander Miller <alexanderm <at> web.de>
Cc: 40849-done <at> debbugs.gnu.org
Subject: Re: bug#40849: 26.3;
 count-screen-lines returns incorrect result when truncated lines are
 counted
Date: Sat, 02 May 2020 11:47:06 +0300
> From: Alexander Miller <alexanderm <at> web.de>
> Date: Sat, 25 Apr 2020 15:45:03 +0200
> 
> Starting from emacs -q run this:
> 
> (progn   (select-window
>     (display-buffer-in-side-window
>      (get-buffer-create (generate-new-buffer-name "*Test*"))
>      '((side . left))))
>    (shrink-window-horizontally  (- (window-width) 10))
>    (insert (make-string 10 ?A) "\n"
>            (make-string 11 ?A) "\n"
>            (make-string 10 ?A))
>    (goto-char 0)
>    (forward-line 1)
>    (count-screen-lines (window-start) (line-end-position)))
> 
> The result will be 3 even though point is on the second line. If the
> window is instead made large enough to accommodate the entire length of
> all inserted lines the result is 2.
> 
> The expected behavior is to return 2 in both situations.

Thanks, I think I fixed this now on the master branch.




This bug report was last modified 5 years and 17 days ago.

Previous Next


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