Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Pazderski2019-07-30 11:29:34 -0400
committerPaul Pazderski2019-08-15 10:00:27 -0400
commit1f65dd6cb8bc86a23dd1c1db5278a627b8f5dea7 (patch)
tree1312d9f6d67fc0586c5d721a7865e239b389e8c3
parent7017d41a622f96dd1c6dcf36b752d8d98af14b5e (diff)
downloadeclipse.platform.text-1f65dd6cb8bc86a23dd1c1db5278a627b8f5dea7.tar.gz
eclipse.platform.text-1f65dd6cb8bc86a23dd1c1db5278a627b8f5dea7.tar.xz
eclipse.platform.text-1f65dd6cb8bc86a23dd1c1db5278a627b8f5dea7.zip
Bug 549663 - Quick search preview dialog mixed line offset and lineI20190817-1800I20190816-1800I20190816-0155
index Change-Id: I969063920308526e237347d8fb6b276215a87cf0 Signed-off-by: Paul Pazderski <paul-eclipse@ppazderski.de>
-rw-r--r--org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/QuickSearchDialog.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/QuickSearchDialog.java b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/QuickSearchDialog.java
index 940dac47d..aaab76374 100644
--- a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/QuickSearchDialog.java
+++ b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/QuickSearchDialog.java
@@ -47,6 +47,7 @@ import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ILazyContentProvider;
@@ -972,7 +973,8 @@ public class QuickSearchDialog extends SelectionStatusDialog {
int start = document.getLineOffset(Math.max(line-(numLines-1)/2, 0));
int end = document.getLength();
try {
- end = document.getLineOffset(start+numLines);
+ IRegion lineInfo = document.getLineInformation(line + numLines/2);
+ end = lineInfo.getOffset() + lineInfo.getLength();
} catch (BadLocationException e) {
//Presumably line number is past the end of document.
//ignore.

Back to the top