Changeset 4357
- Timestamp:
- 10/14/03 00:24:51 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/j/Search.java
r4356 r4357 3 3 * 4 4 * Copyright (C) 1998-2002 Peter Graves 5 * $Id: Search.java,v 1. 6 2003-10-14 00:12:36piso Exp $5 * $Id: Search.java,v 1.7 2003-10-14 00:24:51 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 436 436 } 437 437 } 438 int startIndex = buffer.getAbsoluteOffset(start); 439 final String s = buffer.getText().substring(0, startIndex); 440 while (startIndex >= 0) { 438 int startIndex = 0; 439 int endIndex = buffer.getAbsoluteOffset(start); 440 final String s = buffer.getText().substring(0, endIndex); 441 REMatch lastMatch = null; 442 while (true) { 441 443 match = findMatch(s, startIndex, -1); 442 if (match != null) { 443 if (!wholeWordsOnly) 444 break; 445 if (Utilities.isDelimited(buffer.getMode(), s, 446 match.getStartIndex(), match.getEndIndex())) 447 break; 448 } 449 --startIndex; 450 } 451 if (match == null) 444 if (match == null) 445 break; 446 if (!wholeWordsOnly) 447 lastMatch = match; 448 else if (Utilities.isDelimited(buffer.getMode(), s, 449 match.getStartIndex(), 450 match.getEndIndex())) 451 lastMatch = match; 452 startIndex = match.getStartIndex() + 1; 453 } 454 if (lastMatch == null) 452 455 return null; 456 match = lastMatch; 453 457 return buffer.getPosition(match.getStartIndex()); 454 458 }
Note: See TracChangeset
for help on using the changeset viewer.