From 86d252bd88dcbfb62cd95e8d4ad40d43036418ae Mon Sep 17 00:00:00 2001 From: Oleg Krasilnikov Date: Mon, 5 Jun 2006 13:42:58 +0000 Subject: [PATCH] Bug 141973: Bad cursor position after auto-completion The line in DOMCompletionContributor.handleVariable() : proposal.setCursorPosition(repString.length() - 1); seems to be copied from previous method handleFunction(). It's reasonable for function (put cursor INSIDE brackets after function name), but useless for variable (it has no trailing brackets, so cursor will stop 1 symbol left from the end on variable name). So mentioned line is removed: default cursor position (set inside of CCompletionProposal constructor) is OK. Oleg Krasilnikov --- .../ui/text/contentassist/DOMCompletionContributor.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/DOMCompletionContributor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/DOMCompletionContributor.java index 61ada144b26..28deb369d9d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/DOMCompletionContributor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/DOMCompletionContributor.java @@ -216,9 +216,6 @@ public class DOMCompletionContributor implements ICompletionContributor { int repLength = completionNode.getLength(); int repOffset = offset - repLength; CCompletionProposal proposal = new CCompletionProposal(repString, repOffset, repLength, null, dispString, idString, 1, viewer); - - proposal.setCursorPosition(repString.length() - 1); - proposals.add(proposal); }