[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#38013: [PATCH] Rectangular region selection with mouse
From: |
Mattias Engdegård |
Subject: |
bug#38013: [PATCH] Rectangular region selection with mouse |
Date: |
Sun, 10 Nov 2019 14:49:11 +0100 |
9 nov. 2019 kl. 21.04 skrev Eli Zaretskii <eliz@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)
- bug#38013: [PATCH] Rectangular region selection with mouse, (continued)
- bug#38013: [PATCH] Rectangular region selection with mouse, martin rudalics, 2019/11/07
- bug#38013: [PATCH] Rectangular region selection with mouse, Drew Adams, 2019/11/07
- bug#38013: [PATCH] Rectangular region selection with mouse, Mattias Engdegård, 2019/11/08
- bug#38013: [PATCH] Rectangular region selection with mouse, martin rudalics, 2019/11/08
- bug#38013: [PATCH] Rectangular region selection with mouse, Mattias Engdegård, 2019/11/09
- bug#38013: [PATCH] Rectangular region selection with mouse, Eli Zaretskii, 2019/11/09
- bug#38013: [PATCH] Rectangular region selection with mouse, Mattias Engdegård, 2019/11/09
- bug#38013: [PATCH] Rectangular region selection with mouse, Eli Zaretskii, 2019/11/09
- bug#38013: [PATCH] Rectangular region selection with mouse,
Mattias Engdegård <=
- bug#38013: [PATCH] Rectangular region selection with mouse, Mattias Engdegård, 2019/11/12
- bug#38013: [PATCH] Rectangular region selection with mouse, Drew Adams, 2019/11/12
- bug#38013: [PATCH] Rectangular region selection with mouse, Mattias Engdegård, 2019/11/14
- bug#38013: [PATCH] Rectangular region selection with mouse, Eli Zaretskii, 2019/11/16
- bug#38013: [PATCH] Rectangular region selection with mouse, Mattias Engdegård, 2019/11/17
- bug#38013: [PATCH] Rectangular region selection with mouse, Mattias Engdegård, 2019/11/18
- bug#38013: [PATCH] Rectangular region selection with mouse, Drew Adams, 2019/11/18
- bug#38013: [PATCH] Rectangular region selection with mouse, Juri Linkov, 2019/11/18
- bug#38013: [PATCH] Rectangular region selection with mouse, martin rudalics, 2019/11/19
- bug#38013: [PATCH] Rectangular region selection with mouse, Mattias Engdegård, 2019/11/19