@Override public void reformat() throws BadLocationException { CodeStyle cs = (CodeStyle) doc.getProperty(CodeStyle.class); if (cs == null) { cs = CodeStyle.getDefault(doc); } List<Context.Region> indentRegions = context.indentRegions(); Collections.reverse(indentRegions); for (Context.Region region : indentRegions) { if (initRegionData(region)) { reformatImpl(region, cs); } } }
for (Context.Region region : context.indentRegions()) { reformatImpl(region);
newIndents = new HashMap<Integer, Integer>(); cs = CodeStyle.getDefault(context.document()); for (Region region : context.indentRegions()) { if (initRegionData(region)) { HashSet<Integer> linesToAddStar = new HashSet<Integer>();
@Override public void reformat() throws BadLocationException { if (codeStyle == null){ codeStyle = FortranCodeStyle.get(doc); } codeStyle.setupLexerAttributes(doc); expandTabToSpaces = codeStyle.expandTabToSpaces(); tabSize = codeStyle.getTabSize(); if (tabSize <= 1) { tabSize = 8; } if (context != null) { if (MIMENames.FORTRAN_MIME_TYPE.equals(context.mimePath())) { for (Context.Region region : context.indentRegions()) { TokenSequence<FortranTokenId> ts = CndLexerUtilities.getFortranTokenSequence(doc, 0); reformatImpl(ts, region.getStartOffset(), region.getEndOffset()); break; } } } else { int endOffset = doc.getLength(); TokenSequence<FortranTokenId> ts = CndLexerUtilities.getFortranTokenSequence(doc, 0); reformatImpl(ts, 0, endOffset); } }
Iterator<Region> it = context.indentRegions ().iterator (); while (it.hasNext ()) { Region region = it.next ();