@Override protected IRegion findExtendedDoubleClickSelection(IDocument document, int offset) { IRegion match= characterPairMatcher.match(document, offset); if (match != null && match.getLength() >= 2) return new Region(match.getOffset() + 1, match.getLength() - 2); return findWord(document, offset); }
@Override public void run() { IXtextDocument document = editor.getDocument(); ISelection selection = editor.getSelectionProvider().getSelection(); if (selection instanceof TextSelection) { TextSelection textSelection = (TextSelection) selection; if (textSelection.getLength()==0) { IRegion region = matcher.match(document, textSelection.getOffset()); if (region != null) { if (region.getOffset()+1==textSelection.getOffset()) { editor.selectAndReveal(region.getOffset()+region.getLength(),0); } else { editor.selectAndReveal(region.getOffset()+1,0); } } } } }
return; pair= fMatcher.match(document, selection.getOffset()); characterPresentAtCaretLocation= (pair != null);
return; pair= fMatcher.match(document, selection.getOffset()); characterPresentAtCaretLocation= (pair != null);