]> git.eshelyaron.com Git - emacs.git/commit
Fix 'window-text-pixel-size' when there are leading/trailing spaces
authorAaron Jensen <aaronjensen@gmail.com>
Sun, 10 Jan 2021 02:43:32 +0000 (20:43 -0600)
committerEli Zaretskii <eliz@gnu.org>
Fri, 15 Jan 2021 12:04:25 +0000 (14:04 +0200)
commit4dc72dd9deb1c3394ada3de3f52bc7c1ff831ab6
tree2f6adb25275363194fc4fe35d565c8396c168586
parent66ac17289a5d04366a6b05eb5a105dff408b16b8
Fix 'window-text-pixel-size' when there are leading/trailing spaces

First, scan to find the first non-whitespace character and then
backtrack to find the beginning of the line.  The previous
algorithm always started on the non-whitespace character during
the backtrack, causing it to stop immediately and not actually
find the beginning of the line.  The same applies to the end of
line calculation.
* src/xdisp.c: (Fwindow_text_pixel_size): Fix off by one error.
(Bug#45748)

* test/src/xdisp-tests.el (xdisp-tests--window-text-pixel-size)
(xdisp-tests--window-text-pixel-size-leading-space)
(xdisp-tests--window-text-pixel-size-trailing-space): New tests.
src/xdisp.c
test/src/xdisp-tests.el