I am trying to make it so that I can click on links outputted by xdebug and open the files that have a problem like in textmate only I am trying to do this with ST2 on windows xp.
I tried to use the SublimeProtocol plugin to accomplish this task but the format of the links it expects in order to open a file are like the following:
sblm:///C/Users/name/AppData/Roaming/Sublime%20Text%202/Packages/
and the xdebug.file_link_format is:
xdebug.file_link_format="sblm://%f?%l"
which outputs this this type of link: sblm://C:\wamp\www\busadv\parse3.php?10
so ST2's console indicates that it is unable to open the file.
Then I tried creating a custom protocol based on SO question Creating Custom Protocol since this seemed to be in line with what I was trying to accomplish. I created a reg file with the following:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\sblm]
@="\"URL:sblm Protocol\""
"EditFlags"=hex:02,00,00,00
"URL Protocol"=""
[HKEY_CLASSES_ROOT\sblm\DefaultIcon]
@="\"C:\\Program Files\\Sublime Text 2\\sublime_text.exe\",0"
[HKEY_CLASSES_ROOT\sblm\shell]
[HKEY_CLASSES_ROOT\sblm\shell\open]
[HKEY_CLASSES_ROOT\sblm\shell\open\command]
@="\"C:\\Program Files\\Sublime Text 2\\sublime_text.exe\" -c \"%1\""
The problem is when I click the link output by xdebug a file DOES open in ST2 only file one that is originating in the directory of the browser and not where xdebug is saying its at. I tried replacing the %1 with %2 so the file would chop of the parts before C:\ but the file never opens when that replacement is used. So what are the other parameter needed in order for this to work?
UPDATE:
Added a batch file that contains the following:
@echo off
setlocal enableextensions enabledelayedexpansion
set SUBLIME=%1
set FILE=%~2
%SUBLIME% --open "%FILE:~19%"
and changed the registry to include the .bat as suggested for windows and netbeans to :
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\sblm]
@="URL:sblm Protocol Handler"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\Sublime Text\DefaultIcon]
@="\"C:\\Program Files\\Sublime Text 2\\sublime_text.exe,1\""
[HKEY_CLASSES_ROOT\sblm\shell]
[HKEY_CLASSES_ROOT\sblm\shell\open]
[HKEY_CLASSES_ROOT\sblm\shell\open\command]
@="\"C:\\Windows\\sublime.bat\" \"C:\\Program Files\\Sublime Text 2\\sublime_text.exe\" \%1\""
Also changed the xdebug.file_link_format to
xdebug.file_link_format="sblm://open/?f=%f:%l"
now ST2 still opens a file but it is from the browser directory with the link included almost but excludes C:\w.
For example xdebug link sblm://open/?f=C:\wamp\www\busadv\parse3.php:10
the file opened in ST2 is C:\Program Files\SRWare Iron\amp\www\busadv\parse3.php