+ fix: "Line Comment" id noselection and current pos == indent pos

This commit is contained in:
Rainer Kottenhoff 2018-01-26 23:16:20 +01:00
parent 995dd2f53d
commit 25e4344acf
2 changed files with 8 additions and 6 deletions

View File

@ -2905,7 +2905,7 @@ void EditToggleLineComments(HWND hwnd, LPCWSTR pwszComment, BOOL bInsertAtStart)
if (iLineIndentPos != iLineEndPos) {
const int iIndentColumn = SciCall_GetColumn(iLineIndentPos);
iCommentCol = min(iCommentCol, iIndentColumn);
if ((iLine == iLineStart) && (iIndentColumn >= iSelBegCol)) { iSelStartOffset = 0; }
if ((iLine == iLineStart) && (iIndentColumn > iSelBegCol)) { iSelStartOffset = 0; }
}
else
if (iLine == iLineStart) { iSelStartOffset = 0; }
@ -2938,7 +2938,7 @@ void EditToggleLineComments(HWND hwnd, LPCWSTR pwszComment, BOOL bInsertAtStart)
SendMessage(hwnd, SCI_SETTARGETRANGE, iIndentPos, iIndentPos + cchComment);
SendMessage(hwnd, SCI_REPLACETARGET, 0, (LPARAM)"");
iSelEndOffset -= cchComment;
if (iLine == iLineStart) { iSelStartOffset = 0 - iSelStartOffset; }
if (iLine == iLineStart) { iSelStartOffset = (0 - iSelStartOffset); }
break;
case 1:
break;
@ -2966,8 +2966,10 @@ void EditToggleLineComments(HWND hwnd, LPCWSTR pwszComment, BOOL bInsertAtStart)
if (iCurPos < iAnchorPos)
EditSelectEx(hwnd, iAnchorPos + iSelEndOffset, iCurPos + iSelStartOffset);
else
else if (iCurPos > iAnchorPos)
EditSelectEx(hwnd, iAnchorPos + iSelStartOffset, iCurPos + iSelEndOffset);
else
EditSelectEx(hwnd, iAnchorPos + iSelStartOffset, iCurPos + iSelStartOffset);
}

View File

@ -6,7 +6,7 @@
* Version.h *
* Based on code from Notepad2-mod, (c) XhmikosR 2010-2015 *
* *
* (c) Rizonesoft 2008-2016 *
* (c) Rizonesoft 2008-2018 *
* https://www.rizonesoft.com *
* *
* *
@ -34,8 +34,8 @@
#define VERSION_FILEVERSION_NUM VERSION_MAJOR,VERSION_MINOR,VERSION_REV,VERSION_BUILD
#define VERSION_FILEVERSION STRINGIFY(VERSION_MAJOR) L"." STRINGIFY(VERSION_MINOR) L"." \
STRINGIFY(VERSION_REV) L"." STRINGIFY(VERSION_BUILD)
#define VERSION_LEGALCOPYRIGHT L"Copyright © 2008-2017 Rizonesoft"
//#define VERSION_LEGALCOPYRIGHT_LONG L"© Rizonesoft 2008-2017"
#define VERSION_LEGALCOPYRIGHT L"Copyright © 2008-2018 Rizonesoft"
//#define VERSION_LEGALCOPYRIGHT_LONG L"© Rizonesoft 2008-2018"
#define VERSION_AUTHORNAME L"© Rizonesoft"
#define VERSION_WEBPAGEDISPLAY L"https://www.rizonesoft.com"
#define VERSION_COMPANYNAME L"© Rizonesoft"