SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Siegfried Pammer

AvalonEdit 4.2: Virtual Space

In recent builds of SharpDevelop 4.2 and AvalonEdit I implemented the "Virtual Space" feature. This feature allows you to place the caret after the end of the line. It was necessary to properly implement rectangle selection.

You can enable it in the TextEditor by setting EnableVirtualSpace = true or in the SharpDevelop options. When a rectangle selection is active virtual space is enabled implicitly.

For a detailed overview/explanation see the following:

I hope you find this useful. If you find any bugs or have a suggestion, please leave a comment!

Comments

 

lemi said:

Very nice function, but how can I activate it?

I use SharpDevelop 4.2.0.8283.

I did not find it in the options.

Thanks

lemi

November 29, 2011 1:02 PM
 

siegi44 said:

Hi,

I forgot to push the option. Should be available in 4.2.0.8285.

regards,

Siegfried

November 29, 2011 8:35 PM
 

lemi said:

Thanks

lemi

November 30, 2011 7:29 AM
 

lemi said:

I have tested now the Virtual Space a little bit.

Following problem I have found:

If you set the cursor at the end of a line and you want to delete the linefeed it does not work. The cursor moves to the right.

Also there is a missing localize resource for the setting EnableVirtualSpace.

November 30, 2011 9:25 AM
 

FSchneidereit said:

This behavior is strange, both the old rectangle/box selection in the first example and the virtual space-based one. Look at major code editors or word processors: All of them (Notepad, Word 2010, VS 2010, etc.) implement a selection method like in the third example (normal selection, no virtual space), and for me it's the intentional and expected behavior. I mean, in what scenario is a rectangular selection using virtual space really useful?

Feels wrong to select something (virtual space) that isn't there. People maybe don't get it straight and think there's a bunch of unnecessary white-space at the end of each line...

November 30, 2011 7:52 PM
 

DanielGrunwald said:

@FSchneidereit:

Both Word 2010 and VS 2010 have the rectangle selection feature (with virtual space). Of course it's not replacing the normal selection, but an additional feature - you have to press Alt to create a rectangle selection.

Rectangle selection is useful whenever you have some sort of table. For example, if there are 5 int variables defined in 5 consecutive lines, you can use a rectangle selection to change all of them to "long" at the same time.

"Feels wrong to select something (virtual space) that isn't there." - virtual space means exactly that: pretend that there is an infinite amount of spaces at the end of each line. Almost every code editor has this feature (usually disabled by default).

December 1, 2011 9:00 PM
 

Andrew Olson said:

This is awesome!  I use this in Visual Studio all the time.

One thing- could you implement keyboard navigation (alt+shift+arrow keys)?

January 26, 2012 6:07 PM
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.