X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.ui%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fui%2Feditor%2FMatchingBracketsEditStrategy.java;h=68b3f638bc5860af2acc5d32e41b9456bbe4a354;hp=d287325222b617e61a673ee57527e9896200a33c;hb=9712014e959584157b02e594be8719c151b8f5b0;hpb=d14bfb83fddf30539f401de54ce9f61bd0aff25c diff --git a/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/editor/MatchingBracketsEditStrategy.java b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/editor/MatchingBracketsEditStrategy.java index d28732522..68b3f638b 100644 --- a/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/editor/MatchingBracketsEditStrategy.java +++ b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/editor/MatchingBracketsEditStrategy.java @@ -10,17 +10,17 @@ public class MatchingBracketsEditStrategy implements IAutoEditStrategy { public void customizeDocumentCommand(IDocument d, DocumentCommand c) { if (c.length == 0 && c.text != null) { - if(c.text.equals("(")) { - c.text = "()"; + if(c.text.equals("(")) { //$NON-NLS-1$ + c.text = "()"; //$NON-NLS-1$ justAddedClosingBracket = ')'; } - else if(c.text.equals("[")) { - c.text = "[]"; + else if(c.text.equals("[")) { //$NON-NLS-1$ + c.text = "[]"; //$NON-NLS-1$ justAddedClosingBracket = ']'; } else { if(c.text.length() == 1 && c.text.charAt(0) == justAddedClosingBracket) { - c.text = ""; + c.text = ""; //$NON-NLS-1$ c.shiftsCaret = false; c.caretOffset = c.offset+1; }