Sorry, my last post was a bit misleading. If I copy soutm and use the text you suggested, it works perfectly.
If, however, the text of the template does not contain $END$, and "Skip if Defined" is not checked, and "Reformat according to style" is not checked, then things get weird. It positions the cursor to the substituted variable (correct), but it also indents all the insert text except the first line by three tab stops (incorrect). Now that I understand about $END$ and "Skip if defined", I believe the bug is this indenting of the inserted code. Obviously not a major problem, but unless there's more I don't understand I still think it's a bug.) Dan "Chris Bartley" <[EMAIL PROTECTED]> wrote in message ahpnpc$562$[EMAIL PROTECTED]">news:ahpnpc$562$[EMAIL PROTECTED]... > I tried reproducing (Win2k sp1, IDEA 637) what you want by copying the soutm > template, and pasting in the text I suggested in my previous message. I > then when to my editor, typed the abbreviation, hit TAB, and it expanded > correctly and placed the cursor in the try block. I then tried typing > something and that worked correctly as well. > > Do you have "Skip if Defined" checked for the $CLASS_NAME$ and $METHOD_NAME$ > variables? You should. Otherwise, IDEA will walk you through each variable > so you can define them before finally placing the cursor at the $END$ > marker. > > chris > > "Daniel Rabe" <[EMAIL PROTECTED]> wrote in message > ahplsu$3h1$[EMAIL PROTECTED]">news:ahplsu$3h1$[EMAIL PROTECTED]... > > Thanks, that helped a lot! > > > > I would argue that there's still a bug in there somewhere (related to #2), > > since what I type is going somewhere other than where the cursor is > > positioned. > > > > "Chris Bartley" <[EMAIL PROTECTED]> wrote in message > > ahninq$qhm$[EMAIL PROTECTED]">news:ahninq$qhm$[EMAIL PROTECTED]... > > > First, change your template text to: > > > > > > try > > > { > > > $END$ > > > } > > > catch ( Throwable ex ) > > > { > > > System.out.println("$CLASS_NAME$.$METHOD_NAME$"); > > > } > > > > > > ...that should fix your second problem. Next, to fix the first problem, > > > click on the "Edit variables" button (it's immediately below the text > area > > > where you edit your template text) and add "className()" for the > > Expression > > > for CLASS_NAME and "methodName()" for the Expression for METHOD_NAME > (you > > > can right-click in the Expression area for a listing of all possible > > > expression functions). > > > > > > An alternate (and perhaps easier) way of doing all this would be to just > > > copy the soutm template by selecting the soutm template and then > clicking > > on > > > the "Copy..." button to the right of the Live Templates listing--that'll > > > duplicate soutm and you can then just modify it for your needs. > > > > > > Hope that helps. > > > > > > chris > > > > > > > > > "Daniel Rabe" <[EMAIL PROTECTED]> wrote in message > > > ahnbpj$lhu$[EMAIL PROTECTED]">news:ahnbpj$lhu$[EMAIL PROTECTED]... > > > > I have a live template whose template text is as follows (I based it > on > > > the > > > > built-in "soutm" template): > > > > > > > > try > > > > { > > > > } > > > > catch ( Throwable ex ) > > > > { > > > > System.out.println("$CLASS_NAME$.$METHOD_NAME$"); > > > > } > > > > > > > > Two problems: > > > > > > > > First, the class name and method name don't get filled in (they *do* > if > > I > > > > use "soutm" in the same context). > > > > > > > > Second, after the template expands, I click just after the "{" of the > > > "try", > > > > and hit Enter. I expect to get a new line inside the try block. > Instead, > > > > everything after the try gets indented and the cursor is repositioned > > > inside > > > > the println(). > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ Eap-bugs mailing list [EMAIL PROTECTED] http://lists.jetbrains.com/mailman/listinfo/eap-bugs
