+ fix: Extended Toggle Line Comment Block should not select last line

This commit is contained in:
Rainer Kottenhoff 2019-09-27 11:29:14 +02:00
parent 62796a9833
commit cbaf98e0b9
4 changed files with 15 additions and 5 deletions

View File

@ -1 +1 @@
2653
2654

View File

@ -3,7 +3,7 @@
<assemblyIdentity
name="Notepad3"
processorArchitecture="*"
version="5.19.926.2653"
version="5.19.927.2654"
type="win32"
/>
<description>Notepad3 BETA</description>

View File

@ -3243,8 +3243,9 @@ void EditToggleLineCommentsSimple(HWND hwnd, LPCWSTR pwszComment, bool bInsertAt
const DocLn iLineStart = SciCall_LineFromPosition(iSelStart);
DocLn iLineEnd = SciCall_LineFromPosition(iSelEnd);
// don't consider (last) line where caret is before 1st column
if (iSelEnd <= SciCall_PositionFromLine(iLineEnd)) {
if ((iLineEnd - iLineStart) >= 1) {
if ((iLineEnd - iLineStart) >= 1) { // except it is the only one
--iLineEnd;
}
}
@ -3383,6 +3384,15 @@ void EditToggleLineCommentsExtended(HWND hwnd, LPCWSTR pwszComment, bool bInsert
const DocLn iLineStart = SciCall_LineFromPosition(iSelStart);
DocLn iLineEnd = SciCall_LineFromPosition(iSelEnd);
if (!Sci_IsMultiOrRectangleSelection()) {
// don't consider (last) line where caret is before 1st column
if (iSelEnd <= SciCall_PositionFromLine(iLineEnd)) {
if ((iLineEnd - iLineStart) >= 1) { // except it is the only one
--iLineEnd;
}
}
}
DocPos iCommentCol = 0;
if (!bInsertAtStart) {

View File

@ -7,8 +7,8 @@
#define SAPPNAME "Notepad3"
#define VERSION_MAJOR 5
#define VERSION_MINOR 19
#define VERSION_REV 926
#define VERSION_BUILD 2653
#define VERSION_REV 927
#define VERSION_BUILD 2654
#define SCINTILLA_VER 420
#define ONIGURUMA_REGEX_VER 6.9.3
#define UCHARDET_VER 2018.09.27