SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Topic started by: bschang on June 25, 2008, 07:26:08 pm

Title: Is it possible to invert the selection?
Post by: bschang on June 25, 2008, 07:26:08 pm
Hello:

I have a document that has some text selected. Is there a way to deselect all the text that is selected, and conversely select all of the text that had not been selected?

For instance, say I have a procedure selected in a file and I'd like to delete everything in that file other than the selected procedure. What is the best way to do this?

Thank you.

Brian Schang
Title: Re: Is it possible to invert the selection?
Post by: chrisant on June 25, 2008, 09:12:56 pm
Inverting a selection would typically result in two disjoint selections, and that's not supported (as far as I know).

Instead you could write a DeleteEverythingButSelectedText macro which could choose from a variety of approaches for how to accomplish the results.
Title: Re: Is it possible to invert the selection?
Post by: hs2 on June 25, 2008, 09:36:03 pm
What about: 'cut > select all > delete > paste' as recorded macro ?
HS2
Title: Re: Is it possible to invert the selection?
Post by: Matthew on June 27, 2008, 03:55:30 am
You could use File > Write Selection menu command and just save over the original file. Or create a macro that uses the put command.
Title: Re: Is it possible to invert the selection?
Post by: bschang on June 28, 2008, 09:17:41 am
Hello:

Thanks for the suggestions. I appreciate the input!

Brian Schang