Any way to select all text between brackets?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Any way to select all text between brackets?

TimM-3
Sorry to bring up all the small UI questions, but with my "how to excite
newcomers to Smalltalk hat on" there are many common ide questions that come
up from people used to Eclipse or Intelli -J who are excited about trying a
dynamic language.

A common one is how to "copy" some code between brackets to paste it
somewhere else. In VisualAge clicking on any bracket selected everything
between the matching bracket - is there a Dolphin equivalent (ideally a
keyboard accelerator). Interestingly Ctrl-] takes you to the end of the
method ;-)

Tim


Reply | Threaded
Open this post in threaded view
|

Re: Any way to select all text between brackets?

Ian Bartholomew-20
Tim,

> A common one is how to "copy" some code between brackets to paste it
> somewhere else. In VisualAge clicking on any bracket selected everything
> between the matching bracket - is there a Dolphin equivalent (ideally a
> keyboard accelerator). Interestingly Ctrl-] takes you to the end of the
> method ;-)

Ctrl-U does a similar job, every time you press it the current selection is
widened.

--
Ian

Use the Reply-To address to contact me.
Mail sent to the From address is ignored.


Reply | Threaded
Open this post in threaded view
|

Re: Any way to select all text between brackets?

Andy Bower-3
In reply to this post by TimM-3
Tim,

> Sorry to bring up all the small UI questions, but with my "how to
> excite newcomers to Smalltalk hat on" there are many common ide
> questions that come up from people used to Eclipse or Intelli -J who
> are excited about trying a dynamic language.
>
> A common one is how to "copy" some code between brackets to paste it
> somewhere else. In VisualAge clicking on any bracket selected
> everything between the matching bracket - is there a Dolphin
> equivalent (ideally a keyboard accelerator). Interestingly Ctrl-]
> takes you to the end of the method ;-)

Try Ctrl+U (#widenSourceSelection); that is probably what you want
although you may have to type is a few times to select a whole block.

Since the Dolphin code editor is based on Scintilla, you will normally
find that it obeys the shortcut keys that are Scintilla defines by
default (unless they are overridden by an explicit Dolphin command).
You can see what these default shortcuts are by looking at the SciTE (a
text editor based on Scintilla) documentation at:

http://www.scintilla.org/SciTEDoc.html

Look for the section entitled "Keyboard Commands".

I seem to remember reading somewhere that Scintilla doesn't support
bracket selection as one of the default commands; certainly it doesn't
appear to be in that list.  Hence, you may have to make do with the
#widenSourceSelection command mentioned above.

Best regards,

Andy Bower
Dolphin Support
www.object-arts.com


Reply | Threaded
Open this post in threaded view
|

Re: Any way to select all text between brackets?

TimM-3
That does the trick nicely - in reading the Scite docs noticed that Ctrl-L
also does line cut (so scratch that feature rquest Andy).

Thanks guys.


"Andy Bower" <[hidden email]> wrote in message
news:[hidden email]...

> Tim,
>
>> Sorry to bring up all the small UI questions, but with my "how to
>> excite newcomers to Smalltalk hat on" there are many common ide
>> questions that come up from people used to Eclipse or Intelli -J who
>> are excited about trying a dynamic language.
>>
>> A common one is how to "copy" some code between brackets to paste it
>> somewhere else. In VisualAge clicking on any bracket selected
>> everything between the matching bracket - is there a Dolphin
>> equivalent (ideally a keyboard accelerator). Interestingly Ctrl-]
>> takes you to the end of the method ;-)
>
> Try Ctrl+U (#widenSourceSelection); that is probably what you want
> although you may have to type is a few times to select a whole block.
>
> Since the Dolphin code editor is based on Scintilla, you will normally
> find that it obeys the shortcut keys that are Scintilla defines by
> default (unless they are overridden by an explicit Dolphin command).
> You can see what these default shortcuts are by looking at the SciTE (a
> text editor based on Scintilla) documentation at:
>
> http://www.scintilla.org/SciTEDoc.html
>
> Look for the section entitled "Keyboard Commands".
>
> I seem to remember reading somewhere that Scintilla doesn't support
> bracket selection as one of the default commands; certainly it doesn't
> appear to be in that list.  Hence, you may have to make do with the
> #widenSourceSelection command mentioned above.
>
> Best regards,
>
> Andy Bower
> Dolphin Support
> www.object-arts.com


Reply | Threaded
Open this post in threaded view
|

Re: Any way to select all text between brackets?

Osvaldo Aufiero-4
In reply to this post by TimM-3
Anyway... be careful when copying and pasting...
Generally using copy + paste is an indicator that you are not (re)using your
code efficiently ;)

Regards,

Osvaldo

"TimM" <[hidden email]> escribió en el mensaje
news:[hidden email]...
> Sorry to bring up all the small UI questions, but with my "how to excite
> newcomers to Smalltalk hat on" there are many common ide questions that
come
> up from people used to Eclipse or Intelli -J who are excited about trying
a

> dynamic language.
>
> A common one is how to "copy" some code between brackets to paste it
> somewhere else. In VisualAge clicking on any bracket selected everything
> between the matching bracket - is there a Dolphin equivalent (ideally a
> keyboard accelerator). Interestingly Ctrl-] takes you to the end of the
> method ;-)
>
> Tim
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Any way to select all text between brackets?

TimM-3
Agreed - although the "get it working" then refactor it tenant also applies.
So its acceptable to cut and paste the code - get your test working, and
then refactor out the duplication is a good principle.

Of course - to factor out duplication often requires an easy way to select
code in a block (and Ctrl-U does work quite effectively - although you need
to practice as there is no - "Narrow scope" if you press it one time too
many ;-)

Tim

"Osvaldo Aufiero" <[hidden email]> wrote in message
news:[hidden email]...

> Anyway... be careful when copying and pasting...
> Generally using copy + paste is an indicator that you are not (re)using
> your
> code efficiently ;)
>
> Regards,
>
> Osvaldo
>
> "TimM" <[hidden email]> escribió en el mensaje
> news:[hidden email]...
>> Sorry to bring up all the small UI questions, but with my "how to excite
>> newcomers to Smalltalk hat on" there are many common ide questions that
> come
>> up from people used to Eclipse or Intelli -J who are excited about trying
> a
>> dynamic language.
>>
>> A common one is how to "copy" some code between brackets to paste it
>> somewhere else. In VisualAge clicking on any bracket selected everything
>> between the matching bracket - is there a Dolphin equivalent (ideally a
>> keyboard accelerator). Interestingly Ctrl-] takes you to the end of the
>> method ;-)
>>
>> Tim
>>
>>
>
>