I have made a few enhancements that I would love to see included. Basically I upgraded the rectangular selection mode so it can be used the same way as in Visual Studio which I am used to. It is now possible to switch to rectangular mode by pressing the Alt key when a selection is in progress (with the mouse, it already worked with the keyboard). Another enhancement is that rectangular mode is sticky (selection stays in rectangular mode even if Alt is being released). Since this one is up to personal preference and I don't want to break anything, I made it an option and left it off by default.
To allow the mode switch for mouse selections, I extended Editor::ButtonMove() to have the same parameters as ButtonDown(). I extended ButtonUp() as well for consistency, although I didn't use the other modifier keys in there. I implemented the necessary changes for all platforms, but could test only Win32 myself, so a quick functionality check on the other platforms is still needed.
There are now two new functions in Scintilla.iface to set and get the new option. I based them on the multiple selection option and gave them new ids following the previous largest 2xxx value, so it should be correct. But I didn't generate Scintilla.h (don't know how right now), instead I added them there manually. So a quick check if everything is correct is still needed.
While making and testing these changes, I came across a previously existing bug with switching to rectangular selection mode. To reproduce, copy this text into an editor and follow the steps...
The line containing the B was not updated, part of the old selection remains. It is just a drawing issue, the line didn't get invalidated for drawing because the +1 in Editor::InvalidateSelection() didn't reach the lower line. When moving the cursor into or below that line or resizing the window, it gets updated. Maybe that doesn't happen on all platforms, but for me (Windows 7 x64) it does. The fix for that problem is included in the patch, that is what the additional InvalidateSelection() in Editor::MovePositionTo() is for.
Log in to post a comment.