<div class="markdown">
<p dir="auto">On 3 Apr 2014, at 9:03, Allan Odgaard wrote:</p>
<blockquote>
<p dir="auto">On 3 Apr 2014, at 13:45, Ingo Lantschner wrote:</p>
<blockquote>
<p dir="auto">[…] But it has some side-effects: E.g. the change from double-quotes to single-quotes by pressing <code>Ctrl+Shift+"</code> does not work any more. Plus I would like to change the formatting (color, ...) to something different.</p>
<p dir="auto">What would be the the best way?</p>
</blockquote>
<p dir="auto">To make toggling quotes work, add proper scope to the string part, e.g.:</p>
<pre><code>{ patterns = (
{ name = 'comment.line.debug.perl';
match = '\bi ((''.*'')|(".*")|(q{.*})|(qq{.*}));';
},
captures = {
2 = { name = 'string.quoted.single'; };
3 = { name = 'string.quoted.double'; };
4 = { name = 'string.quoted.other.q.perl'; };
5 = { name = 'string.quoted.other.qq.perl'; };
};
);
</code></pre>
</blockquote>
<p dir="auto">hmh, the code above did not parse. I changed it to this one, which I could save:</p>
<pre><code> { patterns = (
{ name = 'comment.line.debug.perl';
match = '\bi ''.*'';|\bi ".*";|\bi q{.*};|\bi qq{.*};';
captures = {
2 = { name = 'string.quoted.single'; };
3 = { name = 'string.quoted.double'; };
4 = { name = 'string.quoted.other.q.perl'; };
5 = { name = 'string.quoted.other.qq.perl'; };
};
},
);
}
</code></pre>
<p dir="auto">But it still has no effect on the toggling of quotes. Just to avoid miss-understandings: This is part of my personal bundle (Language Grammar, Grammar: source.untitled, Injection-Selector: source.perl)</p>
<blockquote>
<p dir="auto">As for formatting, this would need to be added to the current theme (or possibly as global settings).</p>
<p dir="auto">Here you would target <code>comment.line.debug.perl</code> in the theme.</p>
</blockquote>
<p dir="auto">Ok, thanks! How could I create a new "target", completely unrelated to<br>
comments. The present solution, to treat lines starting with <code>i</code> as comments is<br>
more a workaround. In fact these lines are valid and executed Perl code. What I<br>
really would like to see, is that they are <strong>presented</strong> (but not treated) like<br>
comments.</p>
<p dir="auto">Kind regards, Ingo </p>
<p dir="auto">-- <br>
Ingo Lantschner</p>
</div>