From 424da9caebae33e3c786ffa67a9e5644ac5b97f8 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Thu, 5 Oct 2017 12:54:07 +0200 Subject: [PATCH] + fix: support pasting position at virtual space --- src/Notepad3.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Notepad3.c b/src/Notepad3.c index eae7007ff..3fc0b5e08 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -3094,14 +3094,16 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam) int iCurPos = (int)SendMessage(hwndEdit,SCI_GETCURRENTPOS,0,0); int iCurrLine = (int)SendMessage(hwndEdit,SCI_LINEFROMPOSITION,(WPARAM)iCurPos,0); int iCurColumn = (int)SendMessage(hwndEdit,SCI_GETCOLUMN,(WPARAM)iCurPos,0); + int iCurVSpace = (int)SendMessage(hwndEdit, SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE, 0, 0); SendMessage(hwndEdit, SCI_PASTE, 0, 0); + if (bSwapClipBoard) SendMessage(hwndEdit, SCI_COPYTEXT, 0, (LPARAM)NULL); int newLn = iCurrLine + lineCount + 1; int newCol = (lenLastLine > 1) ? ((lineCount == 0) ? (iCurColumn + lenLastLine + 1) : lenLastLine) : iCurColumn + 1; - EditJumpTo(hwndEdit, newLn, newCol); + EditJumpTo(hwndEdit, newLn, newCol + iCurVSpace); } else {