Enable Multi-Cursor Editing

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Tristano
Enthusiast
Enthusiast
Posts: 190
Joined: Thu Nov 26, 2015 6:52 pm
Location: Italy
Contact:

Enable Multi-Cursor Editing

Post by Tristano »

I've noticed that currently PB IDE does allow multi-cursors: pressing up/down arrow keys while holding Alt + Shift will add cursors above/below the current line; but then editing only actually affects a single cursor. Multi-line rectangular selections can be deleted correctly though, which is already a full-fledged multiple-selection feature (even though the selection area is a single one, it actually consists in multiple selections from different lines).

Mouse "Column Selections", via Alt + Shift and Left-Mouse Button, also works and, again, the resulting multi-line "rectangular selection" can actually be deleted correctly, but not edited (editing would affect a single cursor).

I think that this is due to Scintilla native behavior, as this is the way Notepad++ uses multi-cursor editing — ie: via Alt + Shift and arrows or mouse, except that Notepad++ supports multiple selections text editing.

So it looks like multi-cursor editing support could be implemented in PB IDE, and it's just a step away, as multiple cursors and selections are already supported — and indeed user eddy has provided some good Scintilla examples of this:

http://www.purebasic.fr/english/viewtop ... lla+static

Being able to enter/delete text on multiple lines would be a great IDE improvement, especially for those of us who are used to work with this feature on other editors and really miss it in PB IDE.

Implementing text-editing support for multiple selections would immediately pave the way to lot's of editing features (borrowing from Sublime Text, as an example):

- Alt+F3 (Find All) — to add all occurrences of the current word to the selection
- Ctrl+Shift+L — to split a selection into Lines
- Ctrl+D — to add the next occurrence of the current word to the selection

For a full list of multiple selection features of ST, see:

https://www.sublimetext.com/docs/3/mult ... board.html

Also, it would be worth mentioning in the Documentation the currently supported multiple-selections features (even if it only applies to deletions, it's still a very useful feature, yet it's undocumented).
The PureBASIC Archives: FOSS Resources:
User avatar
Sicro
Enthusiast
Enthusiast
Posts: 538
Joined: Wed Jun 25, 2014 5:25 pm
Location: Germany
Contact:

Re: Enable Multi-Cursor Editing

Post by Sicro »

Image
Why OpenSource should have a license :: PB-CodeArchiv-Rebirth :: Pleasant-Dark (syntax color scheme) :: RegEx-Engine (compiles RegExes to NFA/DFA)
Manjaro Xfce x64 (Main system) :: Windows 10 Home (VirtualBox) :: Newest PureBasic version
Post Reply