<table><tr><td style="">gregormi added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D17971">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #8C98B8;
color: #6B748C;
font-style: italic;
margin: 4px 0 12px 0;
padding: 8px 12px;
background-color: #F8F9FC;">
<div style="font-style: normal;
padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D17971#404900" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;">D17971#404900</a>, <a href="https://phabricator.kde.org/p/dhaumann/" style="
border-color: #f1f7ff;
color: #19558d;
background-color: #f1f7ff;
border: 1px solid transparent;
border-radius: 3px;
font-weight: bold;
padding: 0 4px;">@dhaumann</a> wrote:</div>
<div style="margin: 0;
padding: 0;
border: 0;
color: rgb(107, 116, 140);"><p><a href="https://phabricator.kde.org/p/gregormi/" style="
border-color: #f1f7ff;
color: #19558d;
background-color: #f1f7ff;
border: 1px solid transparent;
border-radius: 3px;
font-weight: bold;
padding: 0 4px;">@gregormi</a></p>
<ul class="remarkup-list">
<li class="remarkup-list-item">Output "Replace Current Document": works fine. Idea: restore cursor position after operation.<ul class="remarkup-list">
<li class="remarkup-list-item">Given the document usually changed afterwards, "restoring the cursor position" is pretty much undefined, and almost never correct...</li>
</ul></li>
</ul></div>
</blockquote>
<p>Hmm. My idea came from this siutation: 1) have an XML document open, 2) cursor somewhere near the top, 3) Run Format document. => View is scrolled down to the bottom. More comfortable would feel if the view would stay somewhere around the original position (must not be exact). Especially when formatting almost correctly formatted documents the document does not change that much. In any case: a nice-to-have feature.</p>
<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><ul class="remarkup-list">
<li class="remarkup-list-item">Make tools available by default: I don't want to clutter the user with hundreds of tools. That's why I proposed the "Template". In general, I am not a big fan of adding everything "just because we can".</li>
</ul></blockquote>
<p>I'm looking forward to having 100 tools :-). One thing came to my mind: what if we had <strong>externalstools.default</strong> and <strong>externaltools.extra</strong>? The tools defined in the first file are added by default. The second file contains those tools that must be added via "Templates". Personal note on the name "template": for a ready-made tool that can just be used as it is (which hopefully most of the tools are), the term "template" does not fit so good.</p>
<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><ul class="remarkup-list">
<li class="remarkup-list-item">Auto quoting: Currently I use <tt style="background: #ebebeb; font-size: 13px;">KShell::splitArgs(m_tool->arguments)</tt> to get a list that I can pass to the QProcess. I assumed that this is correct in mooooost of the cases. Do we really want to have manual work here? Where is your bug? ;)</li>
</ul></blockquote>
<p>My bug: <tt style="background: #ebebeb; font-size: 13px;">cowsay Hello World</tt></p>
<p>shows</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);"> _______________
< 'Hello World' >
---------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||</pre></div>
<p>via the plugin, instead of</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);"> _____________
< Hello World >
-------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||</pre></div>
<p>...let us call it a minor bug ;-) and set it aside for now.</p>
<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><ul class="remarkup-list">
<li class="remarkup-list-item">ideas for later: git, select a branch: I don't have plans to extend a general purpose tool (external tools) into something that needs a lot of special handling. If you have a general purpose solution, fine, otherwise: wish rejected.</li>
</ul></blockquote>
<p>I thought about a general purpose solution: What about adding a new variable <strong>"ExternalTools:ScriptsPath"</strong> which points to a (new) directory "scripts" which is located in parallel to the externaltools file? In this directory scripts can be added that fulfill more special yet useful tasks, like the mentioned git tasks. I can also imagine more complex scripts that extract useful information out of the git repo and show it as HTML file (e.g. author statistics, extended blame or log info etc.) or help to extract a subfolder as a new git repository preserving its history.</p>
<p>By the way: idea for later for another Output type: <strong>"Show as popup"</strong> or "Display as inline note". This could be used for tools with little output like "Git Blame / Who touched this line last?" which runs only on the currently selected line.</p>
<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>The following list is my current proposal of variables. These variables already vary from Qt Creator. Not everything else matches anyways:<br />
...<br />
Any objections or additons to this?</p></blockquote>
<p>Looks good. Is there a specific reason why the "variables already vary from Qt Creator"? I thought a goal was to make them as similar as possible. Otherwise fine.<br />
I am curious: Is there a use case for the global cursor coordinates (in pixels, I suppose)?<br />
For clang-format something like "CurrentDocument:Selection:StartBytes", "CurrentDocument:Selection:EndBytes", and "CurrentDocument:Selection:ByteCount" could be helpful.</p>
<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>CurrentDocument:Selection:Text - Current document: Full path excluding file name.<br />
Time:Loca - The current time in current locale format.</p></blockquote>
<p>minor copy&paste errors</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R40 Kate</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D17971">https://phabricator.kde.org/D17971</a></div></div><br /><div><strong>To: </strong>dhaumann, cullmann, gregormi<br /><strong>Cc: </strong>brauch, pino, ngraham, kwrite-devel, hase, michaelh, demsking, cullmann, sars, dhaumann<br /></div>