Code templates delete selected text

Having trouble installing Oxygen? Got a bug to report? Post it all here.
martindholmes
Posts: 178
Joined: Wed Apr 20, 2005 5:43 pm
Location: Victoria, BC, Canada

Code templates delete selected text

Post 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
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Code templates delete selected text

Post 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
Post Reply