Changeset 4734
- Timestamp:
- 11/14/03 13:32:57 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/j/Editor.java
r4355 r4734 3 3 * 4 4 * Copyright (C) 1998-2003 Peter Graves 5 * $Id: Editor.java,v 1.11 7 2003-10-13 23:56:03piso Exp $5 * $Id: Editor.java,v 1.118 2003-11-14 13:32:57 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 7261 7261 next = next.next(); 7262 7262 if (next != null) { 7263 final String trim = line.trim(); 7263 7264 switch (getModeId()) { 7264 7265 case JAVA_MODE: … … 7268 7269 case PERL_MODE: 7269 7270 case PHP_MODE: 7270 if ( line.trim().endsWith("{")) {7271 if (trim.endsWith("{")) { 7271 7272 if (!next.isHidden()) { 7272 7273 fold(next); … … 7274 7275 } 7275 7276 } 7276 if ( line.trim().startsWith("}")) {7277 if (trim.startsWith("}")) { 7277 7278 // We're at the end of a code block. Find the start of 7278 7279 // the block and fold from there. … … 7304 7305 } 7305 7306 break; 7307 case XML_MODE: { 7308 if (trim.startsWith("/>") || trim.startsWith("</")) { 7309 Line prev = line.previous(); 7310 while (prev != null && prev.isBlank()) 7311 prev = prev.previous(); 7312 if (prev != null) { 7313 int indent = 7314 buffer.getCol(line, line.getIndentation()); 7315 int prevIndent = 7316 buffer.getCol(prev, prev.getIndentation()); 7317 if (indent < prevIndent) { 7318 fold(prev); 7319 return; 7320 } 7321 } 7322 } else if (trim.startsWith("<")) { 7323 int indent = 7324 buffer.getCol(line, line.getIndentation()); 7325 int nextIndent = 7326 buffer.getCol(next, next.getIndentation()); 7327 if (indent < nextIndent) { 7328 fold(next); 7329 return; 7330 } 7331 } 7332 } 7306 7333 default: 7307 7334 break;
Note: See TracChangeset
for help on using the changeset viewer.