From b2a7ca72384c456c4efd9db94e8656ab99332d13 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Sun, 1 Apr 2012 15:34:24 -0700 Subject: [PATCH] Cosmetics. --- .../internal/corext/template/c/CContext.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CContext.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CContext.java index cd757296f6c..74b2f66cb9e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CContext.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CContext.java @@ -63,22 +63,22 @@ public class CContext extends TranslationUnitContext { public int getStart() { if (fIsManaged && getCompletionLength() > 0) return super.getStart(); - + try { IDocument document= getDocument(); int start= getCompletionOffset(); int end= getCompletionOffset() + getCompletionLength(); - + while (start != 0 && isUnicodeIdentifierPartOrPoundSign(document.getChar(start - 1))) start--; - + while (start != end && Character.isWhitespace(document.getChar(start))) start++; - + if (start == end) start= getCompletionOffset(); - + return start; } catch (BadLocationException e) { return super.getStart(); @@ -95,10 +95,10 @@ public class CContext extends TranslationUnitContext { int start= getCompletionOffset(); int end= getCompletionOffset() + getCompletionLength(); - + while (start != end && Character.isWhitespace(document.getChar(end - 1))) end--; - + return end; } catch (BadLocationException e) { return super.getEnd(); @@ -109,7 +109,7 @@ public class CContext extends TranslationUnitContext { public TemplateBuffer evaluate(Template template) throws BadLocationException, TemplateException { if (!canEvaluate(template)) return null; - + TemplateTranslator translator= new TemplateTranslator(); TemplateBuffer buffer= translator.translate(template.getPattern()); @@ -123,7 +123,7 @@ public class CContext extends TranslationUnitContext { CFormatter formatter= new CFormatter(TextUtilities.getDefaultLineDelimiter(getDocument()), indentationLevel, useCodeFormatter, project); formatter.format(buffer, this); - + return buffer; }