GNU bug report logs -
#38013
[PATCH] Rectangular region selection with mouse
Previous Next
Reported by: Mattias EngdegÄrd <mattiase <at> acm.org>
Date: Thu, 31 Oct 2019 23:11:01 UTC
Severity: wishlist
Tags: patch
Fixed in version 27.1
Done: Noam Postavsky <npostavs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #86 received at 38013 <at> debbugs.gnu.org (full text, mbox):
9 nov. 2019 kl. 21.04 skrev Eli Zaretskii <eliz <at> gnu.org>:
> I still see a 1-pixel thin "region" sometimes, which causes the text
> to move horizontally.
Such 'thin' regions (0 cells wide) are legitimate and useful for marking a vertical span of insertion points. For example, they can be used with 'C-x r t' or 'C-x r N'. They are produced in keyboard-based rectangle selection (C-x SPC C-n C-n C-n) as well.
> More importantly, if I drag the mouse through a
> TAB, it moves in jumps of several columns, not one column at a time.
The reason is that 'mouse-movement' events are not generated as long as the mouse stays within the same glyph, and a tab counts as a (suitably wide) single glyph. It can be worked around by zig-zagging the mouse a bit, but I agree it's untidy.
Fixing this requires some work on the lower-level plumbing which I'd hoped to avoid. One possibility is to add a global flag that forces 'remember_mouse_glyph' to consider all text glyphs to have nominal char width, or just zero width.
Or even simpler: assuming that STRETCH_GLYPHS are mostly tabs, we can treat them as image glyphs for 'remember_mouse_glyph' purposes. What about:
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2572,7 +2572,7 @@ remember_mouse_glyph (struct frame *f, int gx, int gy, NativeRectangle *rect)
if (g < end)
{
- if (g->type == IMAGE_GLYPH)
+ if (g->type == IMAGE_GLYPH || g->type == STRETCH_GLYPH)
This bug report was last modified 5 years and 137 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.