GNU bug report logs -
#22873
25.1.50; Feature Request -- Multiple Cursors (built-in support)
Previous Next
Full log
Message #80 received at 22873 <at> debbugs.gnu.org (full text, mbox):
> Date: Sun, 13 Aug 2017 11:19:30 -0700
> From: Keith David Bershatsky <esq <at> lawlist.com>
> Cc: 22873 <at> debbugs.gnu.org,John Wiegley <jwiegley <at> gmail.com>,Marcin Borkowski <mbork <at> mbork.pl>,Richard Stallman <rms <at> gnu.org>
>
> I have encountered a situation where the Y and VPOS coordinates returned by `move_it_to` are sometimes out of bounds, and MATRIX_ROW crashes Emacs when drawing fake cursors that are out of bounds. The solution appears to be a test for whether Y and VPOS are out of bounds.
Actually, the usual solution is to limit move_it_to to
last_visible_y. Are you saying that you already do that, and the
values of Y and VPOS are still out of bounds? That would be strange,
because the display engine does that in many places.
> I would like to use `window_box_height` to give me essentially the same value as `window-body-height` with a non-nil PIXELWISE argument.
And that's not what you get? Can you show a simple example?
`count-screen-lines` is not a viable option because using `vertical-motion` is too slow.
It's strange that you say so because vertical-motion uses the same
move_it_to subroutines that you'd like to use directly.
> Testing and limiting the drawing of fake cursors with `y <= window_box_height (w)` gives me mixed results; i.e., sometimes fake cursors are drawn/erased only up to line 49, but sometimes it works up to line 50 (partially visible). I think I want to test for whether Y is less than or equal to 1000 and if VPOS is less than or equal to 50 -- if the test is true, then go ahead and draw fake cursors up to and including that location.
Are you sure you account for the height of the cursor and the line on
which it is shown? The Y coordinate is where the line begins; it ends
several pixels lower, i.e. at a greater value of Y.
> However, I can foresee situations where there might be mixed line heights on the visible window, and relying upon the frame character height and window body height will not be reliable. In a simple case, we can take 1000 divided by 20 and know that the VPOS is 50.
For reliable calculations, you must do everything in pixels.
> Is there a more reliable test for the last partially visible Y and VPOS within the window body height? Should I be using pos_visible_p in some capacity here?
You could use pos_visible_p, although it, again, uses move_it_to. But
I don't think I have a clear understanding of your problem, so maybe
it's immaterial.
This bug report was last modified 4 years and 353 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.