aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <unknown>2009-08-21 03:24:19 +0000
committernyamatongwe <unknown>2009-08-21 03:24:19 +0000
commit341757686fd87a93bde416a7bf3ca0ce031e8fa8 (patch)
tree4ea065a571fe65cf5b12b78344ba890e3c2d3356 /src
parent64bd824c76a254efcbb42cc169e352b2aad6b4e3 (diff)
downloadscintilla-mirror-341757686fd87a93bde416a7bf3ca0ce031e8fa8.tar.gz
Not reporting an extra byte needed to store selection text.
Fixed implicit line copy case to match stream copy.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 4df7c9247..9f50e331d 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -5330,7 +5330,7 @@ void Editor::CopySelectionRange(SelectionText *ss, bool allowLineCopy) {
strncat(textWithEndl, "\r", textLen);
if (pdoc->eolMode != SC_EOL_CR)
strncat(textWithEndl, "\n", textLen);
- ss->Set(textWithEndl, strlen(textWithEndl),
+ ss->Set(textWithEndl, strlen(textWithEndl) + 1,
pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false, true);
delete []text;
}
@@ -6465,7 +6465,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
SelectionText selectedText;
CopySelectionRange(&selectedText);
if (lParam == 0) {
- return selectedText.len + 1;
+ return selectedText.len ? selectedText.len : 1;
} else {
char *ptr = CharPtrFromSPtr(lParam);
int iChar = 0;