[autocomplete] 53/143: Patch for auto-complete with parameter list separators with length > 2, as well as an off-by-one error in moveToNextParam. Contributed by Matthew Adereth.
Benjamin Mesing
ben at alioth.debian.org
Sat Oct 19 12:53:16 UTC 2013
This is an automated email from the git hooks/post-receive script.
ben pushed a commit to branch master
in repository autocomplete.
commit 18ecabca704a834f2c3e3166bf73f2c9bc574fa3
Author: bobbylight <robert at fifesoft.com>
Date: Mon Oct 25 02:53:21 2010 +0000
Patch for auto-complete with parameter list separators with length > 2, as well as an off-by-one error in moveToNextParam. Contributed by Matthew Adereth.
---
.../ParameterizedCompletionDescriptionToolTip.java | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/org/fife/ui/autocomplete/ParameterizedCompletionDescriptionToolTip.java b/src/org/fife/ui/autocomplete/ParameterizedCompletionDescriptionToolTip.java
index 390cff2..454365f 100644
--- a/src/org/fife/ui/autocomplete/ParameterizedCompletionDescriptionToolTip.java
+++ b/src/org/fife/ui/autocomplete/ParameterizedCompletionDescriptionToolTip.java
@@ -251,7 +251,10 @@ class ParameterizedCompletionDescriptionToolTip {
List highlights = getParameterHighlights();
for (int i=0; i<highlights.size(); i++) {
Highlight hl = (Highlight)highlights.get(i);
- if (currentNext==null || currentNext.getStartOffset()<=dot ||
+ // Check "< dot", not "<= dot" as OutlineHighlightPainter paints
+ // starting at one char AFTER the highlight starts, to work around
+ // Java issue. Thanks to Matthew Adereth!
+ if (currentNext==null || currentNext.getStartOffset()</*=*/dot ||
(hl.getStartOffset()>dot &&
hl.getStartOffset()<=currentNext.getStartOffset())) {
currentNext = hl;
@@ -259,7 +262,7 @@ class ParameterizedCompletionDescriptionToolTip {
}
}
- if (currentNext!=null && dot<currentNext.getStartOffset()) {
+ if (currentNext!=null && dot<=currentNext.getStartOffset()) {
// "+1" is a workaround for Java Highlight issues.
tc.setSelectionStart(currentNext.getStartOffset()+1);
tc.setSelectionEnd(currentNext.getEndOffset());
@@ -747,9 +750,12 @@ class ParameterizedCompletionDescriptionToolTip {
sb.append(paramText);
int end = start + paramText.length();
paramLocs.add(new Point(start, end));
- if (i<paramCount-1) {
- sb.append(pc.getProvider().getParameterListSeparator());
- start = end + 2;
+ // Patch for param. list separators with length > 2 -
+ // thanks to Matthew Adereth!
+ String sep = pc.getProvider().getParameterListSeparator();
+ if (i<paramCount-1 && sep!=null) {
+ sb.append(sep);
+ start = end + sep.length();
}
}
sb.append(pc.getProvider().getParameterListEnd());
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/autocomplete.git
More information about the pkg-java-commits
mailing list