if (doc.getCurlyBracesDenoteCodeBlocks(languageIndex) && getOpenBraceCount(doc, languageIndex)>0) { StringBuilder sb = new StringBuilder();
@Test public void testGetCurlyBracesDenoteCodeBlocks() { // Language that does use curly braces String syntaxStyle = SyntaxConstants.SYNTAX_STYLE_C; doc = new RSyntaxDocument(syntaxStyle); TokenMaker tokenMaker = new CTokenMaker(); Assert.assertEquals(tokenMaker.getCurlyBracesDenoteCodeBlocks(0), doc.getCurlyBracesDenoteCodeBlocks(0)); // Language that does not use curly braces syntaxStyle = SyntaxConstants.SYNTAX_STYLE_XML; doc.setSyntaxStyle(syntaxStyle); tokenMaker = new XMLTokenMaker(); Assert.assertEquals(tokenMaker.getCurlyBracesDenoteCodeBlocks(0), doc.getCurlyBracesDenoteCodeBlocks(0)); // Language in which some sub-languages do, some don't syntaxStyle = SyntaxConstants.SYNTAX_STYLE_HTML; doc.setSyntaxStyle(syntaxStyle); tokenMaker = new HTMLTokenMaker(); Assert.assertEquals(tokenMaker.getCurlyBracesDenoteCodeBlocks(0), doc.getCurlyBracesDenoteCodeBlocks(0)); Assert.assertEquals(tokenMaker.getCurlyBracesDenoteCodeBlocks(1), doc.getCurlyBracesDenoteCodeBlocks(1)); Assert.assertEquals(tokenMaker.getCurlyBracesDenoteCodeBlocks(2), doc.getCurlyBracesDenoteCodeBlocks(2)); // Sanity Assert.assertFalse(tokenMaker.getCurlyBracesDenoteCodeBlocks(0)); Assert.assertTrue(tokenMaker.getCurlyBracesDenoteCodeBlocks(1)); Assert.assertTrue(tokenMaker.getCurlyBracesDenoteCodeBlocks(2)); }
doc.getCurlyBracesDenoteCodeBlocks(languageIndex);
if (doc.getCurlyBracesDenoteCodeBlocks(languageIndex) && getOpenBraceCount(doc, languageIndex)>0) { StringBuilder sb = new StringBuilder();
doc.getCurlyBracesDenoteCodeBlocks(languageIndex);
RSyntaxDocument doc = (RSyntaxDocument)rsta.getDocument(); boolean alignCurlyBraces = rsta.isAutoIndentEnabled() && doc.getCurlyBracesDenoteCodeBlocks();
RSyntaxDocument doc = (RSyntaxDocument)rsta.getDocument(); boolean alignCurlyBraces = rsta.isAutoIndentEnabled() && doc.getCurlyBracesDenoteCodeBlocks();