diff options
| author | nyamatongwe <unknown> | 2001-03-30 04:22:27 +0000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2001-03-30 04:22:27 +0000 | 
| commit | 987232fe6d96acf68b5c8fd606fd36f41fd27be8 (patch) | |
| tree | d5bbdd85fe47c62ee709c102181cc180d5d2a00d | |
| parent | c677c39d261b17936d13c4d73f99a38c8f0aefef (diff) | |
| download | scintilla-mirror-987232fe6d96acf68b5c8fd606fd36f41fd27be8.tar.gz | |
Fixed bug when single character deletions were being coalesced even though
they were not adjacent.
| -rw-r--r-- | src/CellBuffer.cxx | 27 | 
1 files changed, 15 insertions, 12 deletions
| diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx index 84ff1d94d..b410af17c 100644 --- a/src/CellBuffer.cxx +++ b/src/CellBuffer.cxx @@ -456,18 +456,23 @@ void UndoHistory::AppendAction(actionType at, int position, char *data, int leng  			           (position != (actPrevious.position + actPrevious.lenData*2))) {  				// Insertions must be immediately after to coalesce  				currentAction++; -            } else if (!actions[currentAction].mayCoalesce) { +			} else if (!actions[currentAction].mayCoalesce) {  				// Not allowed to coalesce if this set  				currentAction++; -            } else if ((at == removeAction) && (lengthData == 2)) { -                if ((position + lengthData * 2) == actPrevious.position) { -                    ; // Backspace -> OK -                } else if (position == actPrevious.position) { -                    ; // Delete -> OK -                } else { -				    // Removals must be at same position to coalesce -				    currentAction++; -                } +			} else if (at == removeAction) { +				if (lengthData == 2) { +					if ((position + lengthData * 2) == actPrevious.position) { +						; // Backspace -> OK +					} else if (position == actPrevious.position) { +						; // Delete -> OK +					} else { +						// Removals must be at same position to coalesce +						currentAction++; +					} +				} else { +					// Removals must be of one character to coalesce +					currentAction++; +				}  			} else {  				//Platform::DebugPrintf("action coalesced\n");  			} @@ -940,7 +945,6 @@ void CellBuffer::BasicDeleteChars(int position, int deleteLength) {  			ignoreNL = true; 	// First \n is not real deletion  		} -  		char ch = chNext;  		for (int i = 0; i < deleteLength; i += 2) {  			chNext = ' '; @@ -958,7 +962,6 @@ void CellBuffer::BasicDeleteChars(int position, int deleteLength) {  				ignoreNL = false; 	// Further \n are not real deletions  			} -  			ch = chNext;  		}  		// May have to fix up end if last deletion causes cr to be next to lf | 
