diff options
| author | nyamatongwe <unknown> | 2004-03-27 03:47:40 +0000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2004-03-27 03:47:40 +0000 | 
| commit | 93ae9c7f3dc276628d162c53267b65b89685ead2 (patch) | |
| tree | 72454ad7329882bd82bb8f9280531c58a4d5deda /src/Editor.cxx | |
| parent | 850a4e304da0b46578b70b150c641eb51ca5feaf (diff) | |
| download | scintilla-mirror-93ae9c7f3dc276628d162c53267b65b89685ead2.tar.gz | |
Fixed bug when wrapping and undo removes all text in
document.
Diffstat (limited to 'src/Editor.cxx')
| -rw-r--r-- | src/Editor.cxx | 8 | 
1 files changed, 7 insertions, 1 deletions
| diff --git a/src/Editor.cxx b/src/Editor.cxx index 64aa75987..f1f1adb82 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1394,6 +1394,8 @@ void Editor::InvalidateCaret() {  }  void Editor::NeedWrapping(int docLineStartWrapping, int docLineEndWrapping) { +	docLineStartWrapping = Platform::Minimum(docLineStartWrapping, pdoc->LinesTotal()-1); +	docLineEndWrapping = Platform::Minimum(docLineEndWrapping, pdoc->LinesTotal()-1);  	bool noWrap = (docLastLineToWrap == docLineLastWrapped);  	if (docLineLastWrapped > (docLineStartWrapping - 1)) {  		docLineLastWrapped = docLineStartWrapping - 1; @@ -1411,7 +1413,9 @@ void Editor::NeedWrapping(int docLineStartWrapping, int docLineEndWrapping) {  	if (docLastLineToWrap >= pdoc->LinesTotal())  		docLastLineToWrap = pdoc->LinesTotal()-1;  	// Wrap lines during idle. -	if (backgroundWrapEnabled && docLastLineToWrap != docLineLastWrapped ) { +	if ((wrapState != eWrapNone) &&  +		backgroundWrapEnabled &&  +		(docLastLineToWrap != docLineLastWrapped)) {  		SetIdle(true);  	}  } @@ -1492,6 +1496,7 @@ bool Editor::WrapLines(bool fullWrap, int priorityWrapLineStart) {  					firstLineToWrap++;  					if (!priorityWrap)  						docLineLastWrapped++; +					if (firstLineToWrap < pdoc->LinesTotal()) {  					AutoLineLayout ll(llc, RetrieveLineLayout(firstLineToWrap));  					int linesWrapped = 1;  					if (ll) { @@ -1500,6 +1505,7 @@ bool Editor::WrapLines(bool fullWrap, int priorityWrapLineStart) {  					}  					if (cs.SetHeight(firstLineToWrap, linesWrapped)) {  						wrapOccurred = true; +						}  					}  				}  				// If wrapping is done, bring it to resting position | 
