aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2001-01-27 09:30:56 +0000
committernyamatongwe <devnull@localhost>2001-01-27 09:30:56 +0000
commit6e8bfacb4b4db6443d0c1ece1fe3a8fdfdf39e83 (patch)
tree72ca394340bc7dd6d02af61c89ad74d58760fbf9 /src/Editor.cxx
parent91d789b9dfc6c7ced38a9b43f1eeb03d5d331aaa (diff)
downloadscintilla-mirror-6e8bfacb4b4db6443d0c1ece1fe3a8fdfdf39e83.tar.gz
Patch from James to insert spaces when pasting rectangular to keep pasted
text aligned on its left side.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx8
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);