}
}
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);
}
}