+ chg: [Settings2] LineCommentPortfixStrg= e.g. add a space to comment chars

+ ver: update version strings VS 16.3.1
This commit is contained in:
Rainer Kottenhoff 2019-09-26 10:50:58 +02:00
parent d548b98def
commit 172f44ebbc
8 changed files with 46 additions and 10 deletions

View File

@ -42,6 +42,7 @@ SettingsVersion=4
;ExtendedWhiteSpaceChars=:
;AutoCompleteWordCharSet=
;AutoCompleteFillUpChars=
;LineCommentPostfixStrg=
;UpdateDelayMarkAllOccurrences=50
;CurrentLineHorizontalSlop=40
;CurrentLineVerticalSlop=5

View File

@ -1 +1 @@
2649
2650

View File

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

View File

@ -804,6 +804,11 @@ void LoadSettings()
IniSectionGetString(Settings2_Section, L"AutoCompleteFillUpChars", Defaults2.AutoCompleteFillUpChars,
Settings2.AutoCompleteFillUpChars, COUNTOF(Settings2.AutoCompleteFillUpChars));
Defaults2.LineCommentPostfixStrg[0] = L'\0';
IniSectionGetString(Settings2_Section, L"LineCommentPostfixStrg", Defaults2.LineCommentPostfixStrg,
Settings2.LineCommentPostfixStrg, COUNTOF(Settings2.LineCommentPostfixStrg));
StrTrimW(Settings2.LineCommentPostfixStrg, L"\"");
StringCchCopyW(Defaults2.TimeStamp, COUNTOF(Defaults2.TimeStamp), L"\\$Date:[^\\$]+\\$ | $Date: %Y/%m/%d %H:%M:%S $");
IniSectionGetString(Settings2_Section, L"TimeStamp", Defaults2.TimeStamp, Settings2.TimeStamp, COUNTOF(Settings2.TimeStamp));

View File

@ -3183,11 +3183,21 @@ void EditToggleLineCommentsSimple(HWND hwnd, LPCWSTR pwszComment, bool bInsertAt
const DocPos iSelBegCol = SciCall_GetColumn(iSelStart);
char mszComment[32 * 3] = { '\0' };
char mszPrefix[32 * 3] = { '\0' };
char mszPostfix[64 * 3] = { '\0' };
char mszComment[96 * 3] = { '\0' };
if (StrIsNotEmpty(pwszComment)) {
WideCharToMultiByte(Encoding_SciCP, 0, pwszComment, -1, mszComment, COUNTOF(mszComment), NULL, NULL);
WideCharToMultiByte(Encoding_SciCP, 0, pwszComment, -1, mszPrefix, COUNTOF(mszPrefix), NULL, NULL);
if (StrIsNotEmpty(Settings2.LineCommentPostfixStrg)) {
WideCharToMultiByte(Encoding_SciCP, 0, Settings2.LineCommentPostfixStrg, -1, mszPostfix, COUNTOF(mszPostfix), NULL, NULL);
}
StringCchCopyA(mszComment, COUNTOF(mszComment), mszPrefix);
StringCchCatA(mszComment, COUNTOF(mszComment), mszPostfix);
}
DocPos const cchPrefix = (DocPos)StringCchLenA(mszPrefix, COUNTOF(mszPrefix));
DocPos const cchComment = (DocPos)StringCchLenA(mszComment, COUNTOF(mszComment));
if (cchComment == 0) { return; }
@ -3231,7 +3241,7 @@ void EditToggleLineCommentsSimple(HWND hwnd, LPCWSTR pwszComment, bool bInsertAt
int iAction = 0;
for (DocLn iLine = iLineStart; iLine <= iLineEnd; ++iLine)
for (DocLn iLine = iLineStart; iLine <= iLineEnd; ++iLine)
{
DocPos const iIndentPos = SciCall_GetLineIndentPosition(iLine);
@ -3242,9 +3252,9 @@ void EditToggleLineCommentsSimple(HWND hwnd, LPCWSTR pwszComment, bool bInsertAt
}
const char* tchBuf = SciCall_GetRangePointer(iIndentPos, cchComment + 1);
if (StrCmpNIA(tchBuf, mszComment, (int)cchComment) == 0)
if (StrCmpNA(tchBuf, mszComment, (int)cchComment) == 0)
{
// remove comment chars
// remove comment chars incl. Postfix
DocPos const iSelPos = iIndentPos + cchComment;
switch (iAction) {
case 0:
@ -3261,6 +3271,25 @@ void EditToggleLineCommentsSimple(HWND hwnd, LPCWSTR pwszComment, bool bInsertAt
break;
}
}
else if (StrCmpNA(tchBuf, mszPrefix, (int)cchPrefix) == 0)
{
// remove pure comment chars
DocPos const iSelPos = iIndentPos + cchPrefix;
switch (iAction) {
case 0:
iAction = 2;
case 2:
SciCall_SetTargetRange(iIndentPos, iSelPos);
SciCall_ReplaceTarget(0, "");
iSelEndOffset -= cchPrefix;
if (iLine == iLineStart) {
iSelStartOffset = (iSelStart == SciCall_PositionFromLine(iLine)) ? 0 : (0 - cchPrefix);
}
break;
case 1:
break;
}
}
else {
// set comment chars at indent pos
switch (iAction) {

View File

@ -515,6 +515,7 @@ typedef struct _settings2_t
WCHAR FileBrowserPath[MAX_PATH];
WCHAR AppUserModelID[32];
WCHAR AutoCompleteFillUpChars[64];
WCHAR LineCommentPostfixStrg[64];
WCHAR ExtendedWhiteSpaceChars[ANSI_CHAR_BUFFER + 1];
WCHAR AutoCompleteWordCharSet[ANSI_CHAR_BUFFER + 1];
WCHAR TimeStamp[128];

View File

@ -74,7 +74,7 @@
#if defined(_MSC_VER)
#if (_MSC_VER == 1923)
#if(_MSC_FULL_VER >= 192328105)
#define VER_CPL MS Visual C++ 2019 v16.3.0
#define VER_CPL MS Visual C++ 2019 v16.3.(0-1)
#endif
#elif (_MSC_VER == 1922)
#if(_MSC_FULL_VER >= 192227905)

View File

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