diff options
author | nyamatongwe <unknown> | 2001-01-27 09:30:56 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2001-01-27 09:30:56 +0000 |
commit | 4338c7fb40b3ce7a9f546246e038fb8c011eae41 (patch) | |
tree | 72ca394340bc7dd6d02af61c89ad74d58760fbf9 /src | |
parent | 0819e9f2b6210a8eb375a6ef80e912a2d720eaeb (diff) | |
download | scintilla-mirror-4338c7fb40b3ce7a9f546246e038fb8c011eae41.tar.gz |
Patch from James to insert spaces when pasting rectangular to keep pasted
text aligned on its left side.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index e79d43e6f..1ea5d17e4 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1622,7 +1622,15 @@ void Editor::PasteRectangular(int pos, const char *ptr, int len) { if (pdoc->eolMode != SC_EOL_CR) pdoc->InsertChar(pdoc->Length(), '\n'); } + // Pad the end of lines with spaces if required currentPos = PositionFromLineX(line, xInsert); + if ((XFromPosition(currentPos) < xInsert) && (i+1 < len)) { + for (int i=0; i < xInsert - XFromPosition(currentPos); i++) { + pdoc->InsertChar(currentPos, ' '); + currentPos++; + } + insertPos = currentPos; + } prevCr = ptr[i] == '\r'; } else { pdoc->InsertString(currentPos, ptr + i, 1); |