Actually, just thinking. IMHO a template should be triggered, if you are at the end of the token?, so pressing space, *before* the "return" should probably not trigger at all.

then again it is still broken.

tryc|f  ctrl-j

executes the trycf template (as tryc was enough to identify it "tryc| ctrl-j"

but the "f" is kept in the text....


Martin Friebe wrote:
It's probably a bug.
Report it and I can have a look. (or someone, but I am willing, and I probably broke it)

IIRC there the code template, once called, searches the text for the template identifier, so it can repalce it. Seems that if you are at the start of token, it does not find it. (It should find it, since it got invoked / or alternatively, it should not get invoked, if decission was not to work if at start of token. IMHO it should work)

does it also happen, if the caret is in the middle of your token?

Best Regards
Martin



Graeme Geldenhuys wrote:
Hi

I created a while back a code template to fix the case of the word Result. eg: result --> Result

[  Yes, I'm full of sh*t  ]

Anyway, here is the code template as Lazarus wrote it in the .dci file.

=========[ lazarus.dci ]============
[result | Fix case - Result]
$(AttributesStart)
AutoOnWordEnd=true
$(AttributesEnd)
Result
============================


Now look at the animated gif (attached). You might have to view it in your Web Browser to see the animation and to get the full effect of the issue.

  writeln('[DEBUG]Result = ' + Result)
                  ^
           cursor is here

As soon as I press the spacebar while the cursor is between the ']' and the 'R' characters, then Lazarus duplicates the word "Result". Is this a code templates bug, or did I define my code-template incorrectly? And every time I press the spacebar, another duplicate occurs.... Weird one!

Lazarus 0.9.27 rUnknown FPC 2.2.5 i386-linux-gtk 2 (beta)
Lazarus revision is around 2009-06-12 in trunk.



--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to