Permalink
Browse files

Accept current word

git-svn-id: https://jush.svn.sourceforge.net/svnroot/jush/trunk@177 9d3eea12-fc29-0410-b379-a5151d7be1fb
  • Loading branch information...
1 parent 5037caa commit 7bd5380ecd538c5ab848fe6847c64a6b66cb7dc6 jakubvrana committed Mar 30, 2010
Showing with 4 additions and 5 deletions.
  1. +4 −5 jush-help.wsf
View
@@ -1,7 +1,7 @@
<job>
<!-- SciTE: (file must be saved)
file.patterns.jush=*.htm;*.html;*.php;*.sql;*.js;*.css;php.ini;*.conf;.htaccess
-command.help.$(file.patterns.jush)=WScript jush-help.wsf "$(FilePath)" $(SelectionStartLine) $(SelectionStartColumn) $(tabsize)
+command.help.$(file.patterns.jush)=WScript jush-help.wsf "$(FilePath)" $(SelectionStartLine) $(SelectionStartColumn) $(tabsize) "$(CurrentWord)"
-->
<script language="JScript" src="jush.js"></script>
<script language="JScript">
@@ -18,7 +18,7 @@ function openUrl(url) {
}
if (WScript.Arguments.length < 3) {
- WScript.echo('Usage: WScript jush-help.wsf filename line column [tabsize]\nPurpose: Open URL with help on specified position in file');
+ WScript.echo('Usage: WScript jush-help.wsf filename line column [tabsize] [word]\nPurpose: Open URL with help on specified position in file');
WScript.Quit(1);
}
var filename = WScript.Arguments(0);
@@ -50,18 +50,17 @@ while (match = re.exec(s)) {
if (match[1]) {
href = match[1];
} else if (match[2]) {
- if (pos == column) { // last character
- openUrl(href);
+ if (pos == column) { // last character of link
break;
}
href = '';
} else if (match[3]) {
pos += match[3].length;
if (pos > column) {
- openUrl(href ? href : 'http://www.google.com/search?q=' + match[3]); //! urlencode() or current word only
break;
}
}
}
+openUrl(href ? href : 'http://www.google.com/search?q=' + (WScript.Arguments.length >= 4 ? WScript.Arguments(4) : (match ? match[3] : ''))); //! urlencode() or current word only
</script>
</job>

0 comments on commit 7bd5380

Please sign in to comment.