Page 1 of 1

Code templates delete selected text

Posted: Fri Sep 04, 2009 7:10 pm
by martindholmes
I'd really like to use code templates for some of my most common markup tasks, so that I can add (say) a tag with several attributes in one operation. However, if I apply a code template with some text selected, instead of wrapping the template around the selected text, it deletes the selection. I'd like to be able to do this:

[Original text selected]

1984

[Result]

<title level="m">1984</title>

so the template would look something like:

<title level="m">${selection}</title>

Is this possible, or planned for a future version?

Cheers,
Martin

Re: Code templates delete selected text

Posted: Mon Sep 07, 2009 3:36 pm
by sorin_ristache
Hello,

It can be implemented with a custom Author action in Author mode but it is not possible in Text mode. A tag can be inserted together with an attribute in Text mode only with the content completion feature. As with code templates of the current implementation the content completion feature removes the selection so it does not work for you. We will consider it for a future version.


Regards,
Sorin