View | Details | Raw Unified | Return to bug 313594
Collapse All | Expand All

(-)Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java (-5 / +13 lines)
Lines 5331-5336 Link Here
5331
	return -1;
5331
	return -1;
5332
}
5332
}
5333
int getWordNext (int offset, int movement) {
5333
int getWordNext (int offset, int movement) {
5334
	return getWordNext(offset, movement, false);
5335
}
5336
int getWordNext (int offset, int movement, boolean ignoreListener) {
5334
	int newOffset, lineOffset;
5337
	int newOffset, lineOffset;
5335
	String lineText;
5338
	String lineText;
5336
	if (offset >= getCharCount()) {
5339
	if (offset >= getCharCount()) {
Lines 5351-5359 Link Here
5351
			renderer.disposeTextLayout(layout);
5354
			renderer.disposeTextLayout(layout);
5352
		}
5355
		}
5353
	}
5356
	}
5357
	if (ignoreListener) return newOffset; 
5354
	return sendWordBoundaryEvent(WordNext, movement, offset, newOffset, lineText, lineOffset);
5358
	return sendWordBoundaryEvent(WordNext, movement, offset, newOffset, lineText, lineOffset);
5355
}
5359
}
5356
int getWordPrevious(int offset, int movement) {
5360
int getWordPrevious(int offset, int movement) {
5361
	return getWordPrevious(offset, movement, false); 
5362
}
5363
int getWordPrevious(int offset, int movement, boolean ignoreListener) {
5357
	int newOffset, lineOffset;
5364
	int newOffset, lineOffset;
5358
	String lineText;
5365
	String lineText;
5359
	if (offset <= 0) {
5366
	if (offset <= 0) {
Lines 5376-5381 Link Here
5376
			renderer.disposeTextLayout(layout); 
5383
			renderer.disposeTextLayout(layout); 
5377
		}
5384
		}
5378
	}
5385
	}
5386
	if (ignoreListener) return newOffset;
5379
	return sendWordBoundaryEvent(WordPrevious, movement, offset, newOffset, lineText, lineOffset);
5387
	return sendWordBoundaryEvent(WordPrevious, movement, offset, newOffset, lineText, lineOffset);
5380
}
5388
}
5381
/**
5389
/**
Lines 6578-6597 Link Here
6578
					int newCount = 0;
6586
					int newCount = 0;
6579
					if (count > 0) {
6587
					if (count > 0) {
6580
						while (count-- > 0) { 
6588
						while (count-- > 0) { 
6581
							int newEnd = st.getWordNext(end, SWT.MOVEMENT_WORD_START);
6589
							int newEnd = st.getWordNext(end, SWT.MOVEMENT_WORD_START, true);
6582
							if (newEnd == end) break;
6590
							if (newEnd == end) break;
6583
							newCount++;
6591
							newCount++;
6584
							end = newEnd;
6592
							end = newEnd;
6585
						}
6593
						}
6586
						start = end;
6594
						start = end;
6587
						end = st.getWordNext(start, SWT.MOVEMENT_WORD_END);
6595
						end = st.getWordNext(start, SWT.MOVEMENT_WORD_END, true);
6588
					} else {
6596
					} else {
6589
						if (st.getWordPrevious(Math.min(start + 1, contentLength), SWT.MOVEMENT_WORD_START) == start) {
6597
						if (st.getWordPrevious(Math.min(start + 1, contentLength), SWT.MOVEMENT_WORD_START, true) == start) {
6590
							//start is a word start already
6598
							//start is a word start already
6591
							count++;
6599
							count++;
6592
						}
6600
						}
6593
						while (count <= 0) {
6601
						while (count <= 0) {
6594
							int newStart = st.getWordPrevious(start, SWT.MOVEMENT_WORD_START);
6602
							int newStart = st.getWordPrevious(start, SWT.MOVEMENT_WORD_START, true);
6595
							if (newStart == start) break;
6603
							if (newStart == start) break;
6596
							count++;
6604
							count++;
6597
							start = newStart;
6605
							start = newStart;
Lines 6600-6606 Link Here
6600
						if (count <= 0 && start == 0) {
6608
						if (count <= 0 && start == 0) {
6601
							end = start;
6609
							end = start;
6602
						} else {
6610
						} else {
6603
							end = st.getWordNext(start, SWT.MOVEMENT_WORD_END);
6611
							end = st.getWordNext(start, SWT.MOVEMENT_WORD_END, true);
6604
						}
6612
						}
6605
					}
6613
					}
6606
					count = newCount;
6614
					count = newCount;

Return to bug 313594