Column selection mode

19 views
Skip to first unread message

Chinh Nguyen

unread,
Dec 13, 2016, 3:35:40 PM12/13/16
to scintilla-interest
I've been asked to implement a column selection mode in the editor. Instead of requiring that the alt key be pressed to make a rectangular selection, you can just toggle all selections to be rectangular or not. A lot of people don't know that rectangular selections are possible much less the key combination to do it so this is supposed to be a bit more obvious. I'm not crazy about the request because it's more of a documentation issue but I'm begrudgingly doing it.

Before I digging around in Scintilla to add this feature, I checked the documentation to see if it's already possible. I thought SCI_SETSELECTIONMODE might be what I need but it doesn't seem to do what I want. As a matter fact, it doesn't seem to do anything because setting it to SC_SEL_RECTANGLE doesn't seem to have any effect on making a selection. Am I just using it wrong? All I did was set SCI_SETSELECTIONMODE to SC_SEL_RECTANGLE and try to make a selection with both keyboard and mouse. I just got a regular selection instead of a rectangular one. Am I just misunderstanding what it does or using it incorrectly? The mode is currently toggled by a menu item.

I should note that I'm currently implementing this on a Mac which is my preferred development environment but will be porting this over to the Windows and GTK+ versions too.

Neil Hodgson

unread,
Dec 13, 2016, 5:17:28 PM12/13/16
to scintilla...@googlegroups.com
Chinh Nguyen:

> I've been asked to implement a column selection mode in the editor. …. I thought SCI_SETSELECTIONMODE might be what I need but it doesn't seem to do what I want. As a matter fact, it doesn't seem to do anything because setting it to SC_SEL_RECTANGLE doesn't seem to have any effect on making a selection. Am I just using it wrong? All I did was set SCI_SETSELECTIONMODE to SC_SEL_RECTANGLE and try to make a selection with both keyboard and mouse. I just got a regular selection instead of a rectangular one. Am I just misunderstanding what it does or using it incorrectly? The mode is currently toggled by a menu item.

This was introduced in 1.56 by Philippe Lhoste. The initial change set is 1658 and in 2957 the controlling variable was moved into Selection as ‘moveExtends'.
Here is the original mail about the feature.
http://osdir.com/ml/editors.scite.general/2003-10/msg00000.html
The ‘move extends’ mode is not the way I like to work, so it may have decayed. If the feature has stopped working then it will likely be better to work out why and fix it rather than reimplement.

Neil

Reply all
Reply to author
Forward
0 new messages