aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2009-08-28 02:08:48 +0000
committernyamatongwe <unknown>2009-08-28 02:08:48 +0000
commit145d0fb86d7f76a44f4ac0d6ed927b73172a5e87 (patch)
treedcdf9ea390507f69d86041e67734b41cb828e319
parent514b19dcb0fe53d453a313866395fb8d96b26956 (diff)
downloadscintilla-mirror-145d0fb86d7f76a44f4ac0d6ed927b73172a5e87.tar.gz
When pasting into a rectangular selection use the start of the rectangular
selection rather than the start of the main range which is often the last line.
-rw-r--r--gtk/ScintillaGTK.cxx4
-rw-r--r--win32/ScintillaWin.cxx4
2 files changed, 6 insertions, 2 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx
index ab9c9d58a..aec9e1b7a 100644
--- a/gtk/ScintillaGTK.cxx
+++ b/gtk/ScintillaGTK.cxx
@@ -1540,7 +1540,9 @@ void ScintillaGTK::ReceivedSelection(GtkSelectionData *selection_data) {
if (selection_data->selection != GDK_SELECTION_PRIMARY) {
ClearSelection();
}
- SelectionPosition selStart = SelectionStart();
+ SelectionPosition selStart = sel.IsRectangular() ?
+ sel.Rectangular().Start() :
+ sel.Range(sel.Main()).Start();
if (selText.rectangular) {
PasteRectangular(selStart, selText.s, selText.len);
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx
index 6bc39228e..1937458d4 100644
--- a/win32/ScintillaWin.cxx
+++ b/win32/ScintillaWin.cxx
@@ -1362,7 +1362,9 @@ void ScintillaWin::Paste() {
UndoGroup ug(pdoc);
bool isLine = SelectionEmpty() && (::IsClipboardFormatAvailable(cfLineSelect) != 0);
ClearSelection();
- SelectionPosition selStart = sel.Range(sel.Main()).Start();
+ SelectionPosition selStart = sel.IsRectangular() ?
+ sel.Rectangular().Start() :
+ sel.Range(sel.Main()).Start();
bool isRectangular = ::IsClipboardFormatAvailable(cfColumnSelect) != 0;
// Always use CF_UNICODETEXT if available