From d3e3548eaf6ba31eaae830daffb332ac3f080589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?To=CC=83nis=20Simo?= Date: Fri, 21 Dec 2012 18:21:46 +0400 Subject: [PATCH] changed commands * Documentation for word and theme('hook') now also works with selection * convert to variables detects $ symbol --- .../Documentation for theme('hook').tmCommand | 16 +++++++++++++--- Commands/api_drupal_org.tmCommand | 16 +++++++++++++--- Snippets/Convert to $variables.tmSnippet | 2 +- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/Commands/Documentation for theme('hook').tmCommand b/Commands/Documentation for theme('hook').tmCommand index b9d2545..533f8e7 100644 --- a/Commands/Documentation for theme('hook').tmCommand +++ b/Commands/Documentation for theme('hook').tmCommand @@ -8,21 +8,31 @@ #!/usr/bin/env php <?php require $_SERVER['TM_BUNDLE_SUPPORT'] . '/bootstrap.php'; -$url = textmate_docs_for_theme_hook($_SERVER['TM_CURRENT_LINE']); +$request = $_SERVER['TM_SELECTED_TEXT']; +if ($request == '') $request = $_SERVER['TM_CURRENT_WORD']; +$url = textmate_docs_for_theme_hook($request); print '<meta http-equiv="refresh" content="0; URL='. $url .'">'; fallbackInput none input none + inputFormat + text keyEquivalent ^h name Documentation for theme('hook') - output - showAsHTML + outputCaret + afterOutput + outputFormat + html + outputLocation + newWindow scope source.php uuid D8F8FD43-8849-4A1A-89B3-2EEB74601AA2 + version + 2 diff --git a/Commands/api_drupal_org.tmCommand b/Commands/api_drupal_org.tmCommand index 17612bd..b809108 100644 --- a/Commands/api_drupal_org.tmCommand +++ b/Commands/api_drupal_org.tmCommand @@ -8,21 +8,31 @@ #!/usr/bin/env php <?php require $_SERVER['TM_BUNDLE_SUPPORT'] . '/bootstrap.php'; -$url = textmate_docs_for_word($_SERVER['TM_CURRENT_WORD']); +$request = $_SERVER['TM_SELECTED_TEXT']; +if ($request == '') $request = $_SERVER['TM_CURRENT_WORD']; +$url = textmate_docs_for_word($request); print '<meta http-equiv="refresh" content="0; URL='. $url .'">'; fallbackInput none input none + inputFormat + text keyEquivalent ^h name Documentation for Word - output - showAsHTML + outputCaret + afterOutput + outputFormat + html + outputLocation + newWindow scope source.php uuid 5F0E71DA-6D1D-4AFB-A396-31C650F6B313 + version + 2 diff --git a/Snippets/Convert to $variables.tmSnippet b/Snippets/Convert to $variables.tmSnippet index 07f1702..60ad6db 100644 --- a/Snippets/Convert to $variables.tmSnippet +++ b/Snippets/Convert to $variables.tmSnippet @@ -3,7 +3,7 @@ content - variables['${TM_SELECTED_TEXT}'] + \$variables['${1:${TM_SELECTED_TEXT/^\$?(.+$)/$1/g}}']$0 keyEquivalent ^v name