[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] feature/gnus-select c52e2e2 099/218: Fix 'posn-at-point' w
From: |
Andrew G Cohen |
Subject: |
[Emacs-diffs] feature/gnus-select c52e2e2 099/218: Fix 'posn-at-point' when line numbers are displayed |
Date: |
Fri, 14 Dec 2018 03:35:09 -0500 (EST) |
branch: feature/gnus-select
commit c52e2e2fe4e5caf0fee470ec6c154825b33eb26a
Author: Eli Zaretskii <address@hidden>
Commit: Andrew G Cohen <address@hidden>
Fix 'posn-at-point' when line numbers are displayed
* src/xdisp.c (pos_visible_p): For the leftmost glyph, adjust the X
coordinate due to line-number display. (Bug#30834)
---
src/xdisp.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/src/xdisp.c b/src/xdisp.c
index 424f173..a97d4db 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1381,6 +1381,29 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int
*x, int *y,
move_it_to (&it, charpos, -1, it.last_visible_y - 1, -1,
(charpos >= 0 ? MOVE_TO_POS : 0) | MOVE_TO_Y);
+ /* Adjust for line numbers, if CHARPOS is at or beyond first_visible_x,
+ but we didn't yet produce the line-number glyphs. */
+ if (!NILP (Vdisplay_line_numbers)
+ && it.current_x >= it.first_visible_x
+ && IT_CHARPOS (it) == charpos
+ && !it.line_number_produced_p)
+ {
+ /* If the pixel width of line numbers was not yet known, compute
+ it now. This usually happens in the first display line of a
+ window. */
+ if (!it.lnum_pixel_width)
+ {
+ struct it it2;
+ void *it2data = NULL;
+
+ SAVE_IT (it2, it, it2data);
+ move_it_by_lines (&it, 1);
+ it2.lnum_pixel_width = it.lnum_pixel_width;
+ RESTORE_IT (&it, &it2, it2data);
+ }
+ it.current_x += it.lnum_pixel_width;
+ }
+
if (charpos >= 0
&& (((!it.bidi_p || it.bidi_it.scan_dir != -1)
&& IT_CHARPOS (it) >= charpos)
- [Emacs-diffs] feature/gnus-select 520498d 091/218: Improve port to NetBSD tzalloc, (continued)
- [Emacs-diffs] feature/gnus-select 520498d 091/218: Improve port to NetBSD tzalloc, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 02b297b 044/218: ; Revert "; Tracing for eieio-test random failure (Bug#24503)", Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select a381e7e 002/218: Define if-let* and derivatives as aliases for if-let etc, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select a8e5163 070/218: Minor changes in mule.texi, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 03e7331 089/218: * lisp/pcomplete.el (pcomplete-here): Move before first reference., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 040f725 093/218: * lisp/emulation/cua-base.el (cua-paste): Quieten compilation., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select f5219ae 094/218: Replace some obsolete uses of filter-buffer-substring-functions, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 25950c1 095/218: Suppress warnings about obsolete generics (bug#25556), Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 965f4ec 100/218: * lisp/gnus/gnus-registry.el: Add missing compile-time requirement., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select e2aebb9 090/218: * test/lisp/ses-tests.el: Quieten compilation., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select c52e2e2 099/218: Fix 'posn-at-point' when line numbers are displayed,
Andrew G Cohen <=
- [Emacs-diffs] feature/gnus-select e907e4a 102/218: Improve word motion docs (Bug#30815), Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 08b32c9 105/218: Print test timings unconditionally, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 58da563 110/218: * lisp/url/url-handlers.el: Require subr-x., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 513b7fc 111/218: Fix compilation warnings in subr-x-tests.el, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select aceb821 047/218: Remove many items obsolete since Emacs 22.1, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select ec18ff5 118/218: Followup to last change in browse-url.el, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 10794c8 119/218: Print top time consuming tests if advised, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 1ac0958 123/218: Fix recently-added POP doc glitch, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 0f8f94d 121/218: Fix frame resize flicker on macOS (bug#30699), Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select b3c36c4 122/218: Revert move of interactive `transpose-regions' to Lisp, Andrew G Cohen, 2018/12/14