contour
contour copied to clipboard
Right-to-left cell text selection offset off by one on the right?
Contour Terminal version
Contour Terminal Emulator 0.3.3-unreleased-master-480385e7
Installer source
Github: source code cloned
Operating System
Gentoo
Architecture
x86-64
Other Software
No response
Steps to reproduce
Try to select text using mouse right to left
Expected Behavior
The wanted text should be selected
Actual Behavior
Due to cell offsets somehow it select extra character on the right side
Additional notes
No response
Do you mean if you select This is test
from e to T it also selects s and t?
It selects s
not the t
... There is small pixel offset that causes it to sometimes select extra character
I do notice this when I start selection from small characters like.
and ,
.
I do notice this when I start selection from small characters like
.
and,
.
cell based selection is independent from content, so regardless of showing a .
, ,
, or a big M
, it should all be treated the same. Regardless of what is show in a grid cell, they're all having the same dimension.
I think translating from pixel coordinate of the mouse position to containing grid cell is correct. I'd rather assume the cell range algorithm to be bogus. That is, if you start selecting cell based, shortly move to the right (let it be 1ms in fact) but then major move to the left, so you believe you moved left all along, but the move to the right for 1ms, say 3px, was still tracked and that might have taking the next grid cell into account. Then moving to the left, it might end up looking that it accidentally took one too much on the right.
The question is, if you start selecting at column 5, move to column 6, so range [5, 6] is selected, then move to the left column 3: what is selected, [3, 5]
or [3, 6]
? it should be [3, 5]
. I may be wrong, but that is what I'd look at first. hmmmmm.....
I can not reproduce this bug. I while ago bug with selection of single character was fixed https://github.com/contour-terminal/contour/pull/1069 maybe this was affecting this issue
https://github.com/contour-terminal/contour/assets/44506630/87de823c-d5b0-44fc-8ffc-f31ea8ad3d79