On 12/12/2005, at 8:42, Freek Dijkstra wrote:
In the mean time, is there a variable which returns the full word at the place the caret is located, rather then the selected text?
TM_CURRENT_WORD but this is defined by word characters, so if this is to grab the URL you probably want to extract it from TM_CURRENT_LINE instead, using TM_COLUMN_NUMBER as the carets offset into the line. Using the regexp from the plain text grammar (to underline links) a command would be something like:
open $(perl -pe <<<$TM_CURRENT_LINE "s/.{0,$TM_COLUMN_NUMBER}((https?| ftp|mailto):\S+?)(?=[)>,.':;"]*(\s|$)).*/$1/")