diff options
author | nyamatongwe <devnull@localhost> | 2003-03-27 10:13:06 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2003-03-27 10:13:06 +0000 |
commit | 11835bed2e3b63360a961e35107fc8bd2f4b2c63 (patch) | |
tree | e92a0b7ed220ea651fe42852e50ae5ef761eae09 /src | |
parent | 41c60dd01a0968b658fb433e8cf35a36c3b7ac4c (diff) | |
download | scintilla-mirror-11835bed2e3b63360a961e35107fc8bd2f4b2c63.tar.gz |
Fixed up problem where multiple hot spots highlighted at once.
Made line splitting work by taking account of the two bytes needed for a
line end in Windows mode.
Made line joining add a space between each line if there was not one
anyway.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index ae096d50f..a610f260f 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1366,10 +1366,17 @@ bool Editor::WrapLines() { void Editor::LinesJoin() { if (!RangeContainsProtected(targetStart, targetEnd)) { pdoc->BeginUndoAction(); + bool prevNonWS = true; for (int pos = targetStart; pos < targetEnd; pos++) { if (IsEOLChar(pdoc->CharAt(pos))) { targetEnd -= pdoc->LenChar(pos); pdoc->DelChar(pos); + if (prevNonWS) { + // Ensure at least one space separating previous lines + pdoc->InsertChar(pos, ' '); + } + } else { + prevNonWS = pdoc->CharAt(pos) != ' '; } } pdoc->EndUndoAction(); @@ -1403,7 +1410,8 @@ void Editor::LinesSplit(int pixelWidth) { unsigned int posLineStart = pdoc->LineStart(line); LayoutLine(line, surface, vs, ll, pixelWidth); for (int subLine = 1; subLine < ll->lines; subLine++) { - pdoc->InsertString(posLineStart + subLine - 1 + ll->LineStart(subLine), eol); + pdoc->InsertString(posLineStart + (subLine - 1) * strlen(eol) + + ll->LineStart(subLine), eol); targetEnd += strlen(eol); } } @@ -4494,6 +4502,9 @@ void Editor::SetHotSpotRange(Point *pt) { // Only invalidate the range if the hotspot range has changed... if (hsStart_ != hsStart || hsEnd_ != hsEnd) { + if (hsStart != -1) { + InvalidateRange(hsStart, hsEnd); + } hsStart = hsStart_; hsEnd = hsEnd_; InvalidateRange(hsStart, hsEnd); |