Here's how to reproduce:
Modify css.properties like so:
Now create a CSS file like so:
color: inherit; #fbf99d;
There is a space at the end of the first "abcde", but not any others
Rectangular select and copy a column of letters in all the "abcde"'s, say "c".
Move to the end of the first line. Paste.
Expected output (those '.'s are spaces)
Why: the PasteRectangular code in Editor.cxx converts the position to an XOffset.
For example, in the above code, in my view, the position at the end of that
first line is pos 25, translated to xInsert 74
On the second line, before pasting, the xPosition is 66, so scintilla inserts
a space, moving the xPosition to 72. Not enough, so it inserts one more
space, moving xPosition to 80, and breaking out of the loop, as we've reached/passed
I gather the problem is that the initial xInsert looks at the upper-part of the
I haven't figured out why I get the space at the end of each line, but figure
it's for similar reasons.
Here's some debug output:
EOL padding by XFromPosition(sel.MainCaret()):154 : xInsert:162
pdoc->InsertChar(sel.MainCaret():72, ' ')
after inserting, sel.MainCaret():73
... and XFromPosition(caret):160
... XFromPosition(sel.RangeMain().caret):160 # Note: both positions are the same
pdoc->InsertChar(sel.MainCaret():73, ' ')
after inserting, sel.MainCaret():74
... and XFromPosition(caret):168
i: 2, xInsert:162
So we start at X-point 154. We want to be at X-point 162
We insert a space and move over it, but that moves us only to X-point 160
We insert one more space, and now are moved to X-point 168
The first space moved us by 6 pixels, but the second moved us by 8.
In a monospace font, this seems wrong.
Log in to post a comment.