Toad World® Forums

Code Shortcuts


#1

Why can´t I use code shortcuts in the code editor ?

Like:
Shift+Ctrl+P = SELECT * FROM


#2

Hi Bruno, user defined shortcuts for templates will be fixed in the next build, Rgds,Andrew


#3

It is better if template text is not trimmed I mean blanks.
Another one Add special symbol which indicates position of cursor after template is inserted.

Sorry for my English


#4

Hi Bruno,

not too worry much about English. We can communicate. :slight_smile: Can you send us a screenshot showing trimming issue in templates. As for the second issue, I have tested it and whenever I inserted template - a cursor was always visible at the end. What would you like to improve here?

Rgds,
Andrew


#5

About trimming
I have created template for keys Shift+Ctrl+Q='SELECT * FROM '. Last symbol is blank. After that I try to use it and have 'SELECT * FROM’(without blank) in SQL editor.

Second issue. I think it is not issue but can be nice thing. :slight_smile:
For example we create template Shift+Ctrl+P=“RAISE_APPLICATION_ERROR(-20001,’|’);” Symbol “|”(pipe) means position of cursor. It likes on Delphi Code template.

Thank you,
Artem

Message was edited by: Artem
CodeTemplate.jpeg


#6

Thanks for a screenshot and detailed explanation.

First issue looks like a small bug, which we will fix. I have created a change request, but the second issue is a very good enhancement :-), which we will implement in Beta.

Looking forward to hearing more from you,
Andrew


#7

Hi Artem,

I have implemented your enhancement request for the next build. Now you can insert a pipe character ("|") into your templates to indicate the cursor position. This effectively fixes the other issue too: you just define your template as “SELECT * FROM |”.

Best regards,
Roman


#8

Hi Roman,
Thanks a lot. I have one advise for all predefined and user’s templates it is necessary to add pipe character in last position of template becasue new behavior of old templates can confuse user. It will be more frendly

Thank you, Artem

Message was edited by: Artem


#9

Roman,

Can you use something besides a pipe, since pipes may be used in your shortcut?
For example, I like to have a shortcut as the following, and put the cursor where the $ is:
dbms_output.put_line('my_var: ’ || $ );

Thanks.
-Charlie


#10

Charlie
I agree with you.
Roman can you check that Pipe is single? it is necessary for exclude replacement concatenation sign on cursor. Charlie’s template will be dbms_output.put_line('my_var: ’ || | );
Another one if template has no pipe, cursor should be in End position. It will work correct with all old templates.

Thank you, Artem


#11

Hi Charlie and Artem,

I will make sure that both requests are implemented in the next build: to ignore double pipe characters and to place the cursor at the end if there’s no pipe in the shortcut.

Regards,
Roman