Delphi实时模板用括号括起选择

Mar*_*rkF 6 delphi live-templates

我正在尝试制作一个Delphi实时模板(在D2010中)用()包围选择.我目前的尝试看起来像:

<code language="Delphi" delimiter="|"><![CDATA[(|selected|)]]>
Run Code Online (Sandbox Code Playgroud)

它几乎可以工作,但放入额外的空白.如果我有一个代码行,如:

if blah = 5 then
Run Code Online (Sandbox Code Playgroud)

我只选择了blah = 5部分并调用了我想要的模板,如下所示:

if (blah = 5) then
Run Code Online (Sandbox Code Playgroud)

但它最终成为了

if    (  blah = 5) then
Run Code Online (Sandbox Code Playgroud)

有什么建议?

编辑:这是整个模板:

<?xml version="1.0" encoding="utf-8" ?>
<codetemplate   xmlns="http://schemas.borland.com/Delphi/2005/codetemplates"
                version="1.0.0">
    <template name="(" surround="true" invoke="none">
        <description>
          Surround selection by parentheses
        </description>
        <author>
          Mark Ford
        </author>
        <code language="Delphi" delimiter="|"><![CDATA[(|selected|)]]>
        </code>
    </template>
</codetemplate>
Run Code Online (Sandbox Code Playgroud)

Mar*_*rkF 1

这似乎是模板中的错误。它已作为 QC #21276 提交。

http://qc.embarcadero.com/wc/qcmain.aspx?d=21276