Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flybyray/2e485df77b7c614cdf7e695b1075d1e6 to your computer and use it in GitHub Desktop.
Save flybyray/2e485df77b7c614cdf7e695b1075d1e6 to your computer and use it in GitHub Desktop.
# Open file from errors pages
# ~~~~~
# If your text editor supports opening files by URL, Play! will
# dynamically link error pages to files
#
# Example, for textmate:
play.editor=txmt://open?url=file://%s&line=%s&project=file://${application.path}
var editor = 'C:\\dev\\jetbrains\\toolbox\\apps\\IDEA-U\\ch-0\\163.11103.6\\bin\\idea.exe "%project%" --line %line% "%file%"';
var url = WScript.Arguments(0);
var match = /^txmt:\/\/open\/\?url=file:\/\/(.+)&line=(\d+)&project=file:\/\/(.+)$/.exec(url);
if (match) {
var file = decodeURIComponent(match[1]).replace(/\+/g, ' ');
var project = decodeURIComponent(match[3]).replace(/\+/g, ' ');
var command = editor.replace(/%line%/g, match[2]).replace(/%file%/g, file).replace(/%project%/g, project);
var shell = new ActiveXObject("WScript.Shell");
shell.Exec(command.replace(/\\/g, '\\\\'));
}
REGEDIT4
[HKEY_CLASSES_ROOT\txmt]
@="URL:txmt Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\txmt\shell\open\command]
@="wscript \"c:\\dev\\src\\gist\\flybyray\\run-editor.js\" \"%1\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment