misc changes
[phpeclipse.git] / net.sourceforge.phpeclipse.debug.phphelp / src / net / sourceforge / phpdt / phphelp / actions / PHPEclipseShowContextHelp.java
index 027eb91..834d108 100644 (file)
@@ -58,18 +58,18 @@ public class PHPEclipseShowContextHelp extends ActionDelegate implements IEditor
       }
     }
     if (editor != null) {
-      editor.openContextHelp();
+      ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
+      IDocument doc = editor.getDocumentProvider().getDocument(editor.getEditorInput());
+      int pos = selection.getOffset();
+      String word = getFunctionName(doc, pos);
+      openContextHelp(word);
+
     }
   }
 
   public void setActiveEditor(IAction action, IEditorPart targetEditor) {
     if (targetEditor != null && (targetEditor instanceof PHPEditor)) {
       editor = (PHPEditor) targetEditor;
-          IDocument doc = editor.getDocumentProvider().getDocument(editor.getEditorInput());
-    ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
-    int pos = selection.getOffset();
-    String word = getFunctionName(doc, pos);
-    openContextHelp(word);
     }
   }