3

I watched this video:

https://www.youtube.com/watch?v=8LXJfYvq8z8

and tried to make a live template for try catch block.

try {
    $SELECTION$
} catch ($TYPE$ $$$VARIABLENAME$) {
    $END$
}

Now I select a code which I want to be surrounded and choose this template. I get:

try {

        } catch ( $) {

            }

No selected code in try block. What is wrong? Version is 2016.3.2, build on December 20, 2016

Is it a bug or I am doing something wrong?

Dariux
  • 3,953
  • 9
  • 43
  • 69
  • *"Now I select a code which I want to be surrounded and choose this template."* How do you choose a template? It works fine here. You must be doing something wrong. Please illustrate it with screenshot or screencast. – LazyOne Mar 25 '17 at 09:11
  • @LazyOne - found what was wrong, wrote answer. – Dariux Mar 25 '17 at 09:19

1 Answers1

7

Found an answer while watching another video: https://www.youtube.com/watch?v=h5p90FvJo0Y

It turns out that I have to not only select text, but also use different shortcut.

By default it is ctrl + alt + J. I was using ctrl + J so thats why it did not work.

Dariux
  • 3,953
  • 9
  • 43
  • 69