<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">On 24 Aug 2016, at 18:26, Graham Heath wrote:</p>

<p dir="auto">Current test build has a preliminary implementation of this feature.</p>

<p dir="auto"></p></div>
<div style="white-space:pre-wrap"><blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px"><div dir="auto">Thats great news. You mention that the commands could update the HTML view,
</div><div dir="auto">would they also have access to the gutter (and/or tooltips)?
</div></blockquote></div>
<div style="white-space:normal">

<p dir="auto">You can access gutter via <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">$TM_MATE</code> and tool tips can be shown by using <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">$DIALOG</code>.</p>

<p dir="auto"></p></div>
<div style="white-space:pre-wrap"><blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px"><div dir="auto">You’ve got a good point that the process should be killed when a user no
</div><div dir="auto">longer wants it, for my use though I can’t imagine wanting to turn the
</div><div dir="auto">linter service off while TextMate was still open. If there was a
</div><div dir="auto">"application-will-close" event, bundles could be responsible for cleaning
</div><div dir="auto">up after themselves.
</div></blockquote></div>
<div style="white-space:normal">

<p dir="auto">Here is the preliminary documentation (I will likely change the keys to match the semantic classes and also make it a mask rather than either/or):</p>

<hr style="background:#333; background-image:linear-gradient(to right, #ccc, #333, #ccc); border:0; height:1px" height="1">

<p dir="auto">New <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">autoRefresh</code> key that can be set in <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">tmCommand</code>, value can be either:</p>

<ul>
<li><code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">documentDidChange</code>: Re-run the command after document has changed.</li>
<li><code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">documentDidSave</code>: Re-run the command after a file in the project has been saved (after delay to coalesce multiple documents being saved).</li>
</ul>

<p dir="auto">If a document has <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">autoRefresh</code> set to <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">onDocumentChange</code> it will stop running if the document is closed. If there is a HTML output window, this window will then also close.</p>

<p dir="auto">If a command has HTML output, closing the HTML output will stop running the command.</p>

<p dir="auto">If the user runs a command with <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">autoRefresh</code> enabled for a second time, and there is an open HTML output window associated with the command, then it brings the window to front, otherwise it will stop the first instance.</p>

<p dir="auto">For successive command executions the <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">TM_REFREH</code> environment variable is present and set to <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">YES</code>.</p>

<p dir="auto">Planned: If the command’s title matches: <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">(\w+) / (\w+) (.+)</code> then it will show as <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">$1 $3</code> by default and <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">$2 $3</code> when running. This means the command can be named “Show / Hide Preview” and will appear as “Show Preview” unless the preview is already showing, in which case it becomes “Hide Preview”.</p>

<p dir="auto"></p></div>
<div style="white-space:pre-wrap"><blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px"><div dir="auto">Debouncing an event like this over 300ms would mean that the event doesn’t
</div><div dir="auto">fire until 300ms have elapsed where the trigger wasn’t re-triggered.
</div></blockquote></div>
<div style="white-space:normal">

<p dir="auto">Such complicated terms for “when the user is idle” :)</p>
</div>
</div>
</body>
</html>