diff --git a/Versions/build.txt b/Versions/build.txt
index 502380c6c..c9a777fb5 100644
--- a/Versions/build.txt
+++ b/Versions/build.txt
@@ -1 +1 @@
-610
+632
diff --git a/distrib/Changes.txt b/distrib/Changes.txt
index 0e73f6746..17eb2fafa 100644
--- a/distrib/Changes.txt
+++ b/distrib/Changes.txt
@@ -2,6 +2,38 @@
Rizonesoft Notepad3 CHANGES
==================================================
+--------------------------------------------------
+Version 2.17.1023.632 (16 October 2017)
+--------------------------------------------------
+~ Fix: pasting clipboard content into selection box should replace text and
+ cancel selection then (in case of swapping clipboard, the selection is preserved).
+~ Changed buffers for operating edit box in customize schemes.
+~ Implemented Feature Request #51 (buffer size of file extension edit box).
+~ First prottotype of VirtualSpace RectangularSelection by default (very old
+ behavior can be turned on by [Settings2] DenyVirtualSpaceAccess=1).
+~ Added switch ([Settings2] UseOldStyleBraceMatching) to preserve old style
+ brace matching behavior.
+~ Applied patch from Neil Hodgson (Master of Scintilla Lib - respond to
+ scintilla lib issue report #1976).
+~ Fixed .ini paths for np3portableapps.
+~ Restore wrongly discarded np3portableapps .ini files for NP3Portable,
+ redirecting .ini reading to correct path.
+~ Documentation: Minor changes to Notepad3.txt.
+~ Documentation: doc/Notepad3.txt - add description of [Section2] .ini settings
+ (mostly taken from orig. Notepad2 FAQs).
+~ Remove settings for "Favorites" directory -> NP3 uses then users system
+ default folder (%USERPROFILE%\Favorites).
+~ Default to modern displays settings, using Scintilla's new technology
+ : SciDirectWriteTech=1, SciFontQuality=3
+~ Settings [Section2] (cannot be set via GUI) add all possible names and
+ default values, if applicable.
+~ License.txt: switch to UTF-8 encoding.
+~ Feature: Show warning before loading file with unknown (custom schemes) file
+ name extension.
+~ Add code snippet (activation only prepare for future extensions).
+~ Fix: Crash in Favorites management.
+~ Small code refactoring (replacing deprecated methods).
+
--------------------------------------------------
Version 2.17.1016.610 (16 October 2017)
--------------------------------------------------
diff --git a/res/Notepad3.exe.manifest.conf b/res/Notepad3.exe.manifest.conf
index 0dc1f349d..572af4067 100644
--- a/res/Notepad3.exe.manifest.conf
+++ b/res/Notepad3.exe.manifest.conf
@@ -3,7 +3,7 @@
Notepad3
diff --git a/src/Notepad3.c b/src/Notepad3.c
index 20b28e04e..76fc41a01 100644
--- a/src/Notepad3.c
+++ b/src/Notepad3.c
@@ -3045,11 +3045,12 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam)
SendMessage(hwndEdit,SCI_REPLACESEL,0,(LPARAM)pClip);
- if (iCurrPos > iAnchor)
- SendMessage(hwndEdit,SCI_SETSEL, iAnchor, iAnchor + lstrlenA(pClip));
- else
- SendMessage(hwndEdit,SCI_SETSEL, iCurrPos + lstrlenA(pClip), iCurrPos);
-
+ if (bSwapClipBoard) {
+ if (iCurrPos > iAnchor)
+ SendMessage(hwndEdit, SCI_SETSEL, iAnchor, iAnchor + lstrlenA(pClip));
+ else
+ SendMessage(hwndEdit, SCI_SETSEL, iCurrPos + lstrlenA(pClip), iCurrPos);
+ }
}
EndSelUndoAction(token);
LocalFree(pClip);
diff --git a/src/Notepad3.rc b/src/Notepad3.rc
index 614681af0..d0cb0633d 100644
Binary files a/src/Notepad3.rc and b/src/Notepad3.rc differ
diff --git a/src/Styles.c b/src/Styles.c
index 37f2db1f5..76897e3e9 100644
--- a/src/Styles.c
+++ b/src/Styles.c
@@ -3003,7 +3003,7 @@ void Style_SetLexer(HWND hwnd,PEDITLEXER pLexNew)
Style_SetStyles(hwnd,lexDefault.Styles[1+iIdx].iStyle,lexDefault.Styles[1+iIdx].szValue); // linenumber
if (bUseOldStyleBraceMatching) {
- Style_SetStyles(hwnd,lexDefault.Styles[2+iIdx].iStyle,lexDefault.Styles[2+iIdx].szValue); // brace light
+ Style_SetStyles(hwnd,lexDefault.Styles[2+iIdx].iStyle,lexDefault.Styles[2+iIdx].szValue); // brace light
}
else {
if (Style_StrGetColor(TRUE, lexDefault.Styles[2 + iIdx].szValue, &iValue))
@@ -3012,7 +3012,7 @@ void Style_SetLexer(HWND hwnd,PEDITLEXER pLexNew)
SendMessage(hwnd, SCI_INDICSETALPHA, INDIC_NP3_MATCH_BRACE, iValue);
}
if (bUseOldStyleBraceMatching) {
- Style_SetStyles(hwnd, lexDefault.Styles[3 + iIdx].iStyle, lexDefault.Styles[3 + iIdx].szValue); // brace bad
+ Style_SetStyles(hwnd,lexDefault.Styles[3+iIdx].iStyle,lexDefault.Styles[3+iIdx].szValue); // brace bad
}
else {
if (Style_StrGetColor(TRUE, lexDefault.Styles[3 + iIdx].szValue, &iValue))
@@ -3073,7 +3073,7 @@ void Style_SetLexer(HWND hwnd,PEDITLEXER pLexNew)
if (Style_StrGetSize(lexDefault.Styles[7+iIdx].szValue,&iValue)) {
WCHAR tch[32] = { L'\0' };
- WCHAR wchStyle[COUNTOF(lexDefault.Styles[0].szValue)];
+ WCHAR wchStyle[BUFSIZE_STYLE_VALUE];
StringCchCopyN(wchStyle,COUNTOF(wchStyle),lexDefault.Styles[7 + iIdx].szValue,COUNTOF(lexDefault.Styles[7 + iIdx].szValue));
iValue = max(min(iValue,5),0);
@@ -3436,7 +3436,7 @@ PEDITLEXER __fastcall Style_SniffShebang(char *pchText)
//
PEDITLEXER __fastcall Style_MatchLexer(LPCWSTR lpszMatch,BOOL bCheckNames) {
int i;
- WCHAR tch[256 + 16] = { L'\0' };
+ WCHAR tch[COUNTOF(pLexArray[0]->szExtensions)] = { L'\0' };
WCHAR *p1,*p2;
if (!bCheckNames) {
@@ -3801,7 +3801,7 @@ BOOL Style_StrGetFont(LPCWSTR lpszStyle,LPWSTR lpszFont,int cchFont)
//
BOOL Style_StrGetFontQuality(LPCWSTR lpszStyle,LPWSTR lpszQuality,int cchQuality)
{
- WCHAR tch[MIDSZ_BUFFER] = { L'\0' };
+ WCHAR tch[64] = { L'\0' };
WCHAR *p = StrStrI(lpszStyle, L"smoothing:");
if (p)
{
@@ -3855,7 +3855,7 @@ BOOL Style_StrGetCharSet(LPCWSTR lpszStyle,int *i)
//
BOOL Style_StrGetSize(LPCWSTR lpszStyle,int *i)
{
- WCHAR tch[256] = { L'\0' };
+ WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' };
int iSign = 0;
WCHAR *p = StrStrI(lpszStyle, L"size:");
@@ -3897,7 +3897,7 @@ BOOL Style_StrGetSize(LPCWSTR lpszStyle,int *i)
//
BOOL Style_StrGetSizeStr(LPCWSTR lpszStyle,LPWSTR lpszSize,int cchSize)
{
- WCHAR tch[MIDSZ_BUFFER] = { L'\0' };
+ WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' };
WCHAR *p = StrStrI(lpszStyle, L"size:");
if (p)
{
@@ -3919,7 +3919,7 @@ BOOL Style_StrGetSizeStr(LPCWSTR lpszStyle,LPWSTR lpszSize,int cchSize)
//
BOOL Style_StrGetColor(BOOL bFore,LPCWSTR lpszStyle,int *rgb)
{
- WCHAR tch[256] = { L'\0' };
+ WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' };
WCHAR *pItem = (bFore) ? L"fore:" : L"back:";
WCHAR *p = StrStrI(lpszStyle, pItem);
@@ -3946,10 +3946,10 @@ BOOL Style_StrGetColor(BOOL bFore,LPCWSTR lpszStyle,int *rgb)
//=============================================================================
//
-// Style_StrGetAlpha()
+// Style_StrGetCase()
//
BOOL Style_StrGetAlpha(LPCWSTR lpszStyle, int *i) {
- WCHAR tch[256] = { L'\0' };
+ WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' };
WCHAR *p = StrStrI(lpszStyle, L"alpha:");
if (p) {
StringCchCopy(tch, COUNTOF(tch), p + CSTRLEN(L"alpha:"));
@@ -3963,18 +3963,18 @@ BOOL Style_StrGetAlpha(LPCWSTR lpszStyle, int *i) {
*i = min(max(SC_ALPHA_TRANSPARENT, iValue), SC_ALPHA_OPAQUE);
return TRUE;
}
- }
+ }
return FALSE;
}
//=============================================================================
//
-// Style_StrGetCase()
+// Style_StrGetAlpha()
//
BOOL Style_StrGetCase(LPCWSTR lpszStyle,int *i)
{
- WCHAR tch[256] = { L'\0' };
+ WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' };
WCHAR *p = StrStrI(lpszStyle, L"case:");
if (p)
{
@@ -3990,7 +3990,7 @@ BOOL Style_StrGetCase(LPCWSTR lpszStyle,int *i)
else if (tch[0] == L'l' || tch[0] == L'L') {
*i = SC_CASE_LOWER;
return TRUE;
- }
+ }
}
return FALSE;
}
@@ -4004,7 +4004,7 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle
{
CHOOSEFONT cf;
LOGFONT lf;
- WCHAR szNewStyle[512] = { L'\0' };
+ WCHAR szNewStyle[BUFSIZE_STYLE_VALUE] = { L'\0' };
int iValue;
WCHAR tch[LF_FACESIZE+1] = { L'\0' };
HDC hdc;
@@ -4114,7 +4114,7 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle
BOOL Style_SelectColor(HWND hwnd,BOOL bFore,LPWSTR lpszStyle,int cchStyle)
{
CHOOSECOLOR cc;
- WCHAR szNewStyle[512] = { L'\0' };
+ WCHAR szNewStyle[BUFSIZE_STYLE_VALUE] = { L'\0' };
int iRGBResult;
int iValue;
WCHAR tch[64] = { L'\0' };
@@ -4252,12 +4252,12 @@ BOOL Style_SelectColor(HWND hwnd,BOOL bFore,LPWSTR lpszStyle,int cchStyle)
void Style_SetStyles(HWND hwnd,int iStyle,LPCWSTR lpszStyle)
{
- WCHAR tch[256] = { L'\0' };
+ WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' };
int iValue;
// Font
if (Style_StrGetFont(lpszStyle,tch,COUNTOF(tch))) {
- char mch[256] = { '\0' };
+ char mch[BUFSIZE_STYLE_VALUE] = { '\0' };
WideCharToMultiByteStrg(CP_UTF8,tch,mch);
SendMessage(hwnd,SCI_STYLESETFONT,iStyle,(LPARAM)mch);
}
@@ -4316,7 +4316,7 @@ void Style_SetStyles(HWND hwnd,int iStyle,LPCWSTR lpszStyle)
void Style_SetFontQuality(HWND hwnd,LPCWSTR lpszStyle) {
WPARAM wQuality = (WPARAM)FontQuality[iSciFontQuality];;
- WCHAR tch[64] = { L'\0' };
+ WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' };
if (Style_StrGetFontQuality(lpszStyle,tch,COUNTOF(tch))) {
if (StringCchCompareIN(tch,COUNTOF(tch),L"default",-1) == 0)
@@ -4362,26 +4362,23 @@ void Style_GetCurrentLexerName(LPWSTR lpszName,int cchName)
//
int Style_GetLexerIconId(PEDITLEXER plex)
{
- WCHAR *pszExtensions;
- WCHAR *pszFile;
+ WCHAR pszFile[MAX_PATH + BUFZIZE_STYLE_EXTENTIONS];
+ WCHAR *pszExtensions;
if (StringCchLen(plex->szExtensions))
pszExtensions = plex->szExtensions;
else
pszExtensions = plex->pszDefExt;
- size_t len = sizeof(WCHAR)*(StringCchLenN(pszExtensions,230) + CSTRLEN(L"*.txt") + 16);
- pszFile = GlobalAlloc(GPTR,len);
- StringCchCopy(pszFile,len,L"*.");
- StringCchCat(pszFile,len,pszExtensions);
+ StringCchCopy(pszFile,COUNTOF(pszFile),L"*.");
+ StringCchCat(pszFile,COUNTOF(pszFile),pszExtensions);
WCHAR *p = StrChr(pszFile, L';');
- if (p)
- *p = L'\0';
+ if (p) { *p = L'\0'; }
// check for ; at beginning
- if (StringCchLenN(pszFile,MAX_PATH) < 3)
- StringCchCat(pszFile,len,L"txt");
+ if (StringCchLenN(pszFile, COUNTOF(pszFile)) < 3)
+ StringCchCat(pszFile, COUNTOF(pszFile),L"txt");
SHFILEINFO shfi;
ZeroMemory(&shfi,sizeof(SHFILEINFO));
@@ -4389,8 +4386,6 @@ int Style_GetLexerIconId(PEDITLEXER plex)
SHGetFileInfo(pszFile,FILE_ATTRIBUTE_NORMAL,&shfi,sizeof(SHFILEINFO),
SHGFI_SMALLICON | SHGFI_SYSICONINDEX | SHGFI_USEFILEATTRIBUTES);
- GlobalFree(pszFile);
-
return (shfi.iIcon);
}
@@ -4402,7 +4397,7 @@ int Style_GetLexerIconId(PEDITLEXER plex)
HTREEITEM Style_AddLexerToTreeView(HWND hwnd,PEDITLEXER plex)
{
int i = 0;
- WCHAR tch[256] = { L'\0' };
+ WCHAR tch[MIDSZ_BUFFER] = { L'\0' };
HTREEITEM hTreeNode;
@@ -4449,7 +4444,7 @@ HTREEITEM Style_AddLexerToTreeView(HWND hwnd,PEDITLEXER plex)
//
void Style_AddLexerToListView(HWND hwnd,PEDITLEXER plex)
{
- WCHAR tch[256] = { L'\0' };
+ WCHAR tch[MIDSZ_BUFFER] = { L'\0' };
LVITEM lvi;
ZeroMemory(&lvi,sizeof(LVITEM));
@@ -4511,13 +4506,13 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP
Style_AddLexerToTreeView(hwndTV,pLexArray[i]);
}
- pCurrentStyle = 0;
+ pCurrentStyle = NULL;
//SetExplorerTheme(hwndTV);
//TreeView_Expand(hwndTV,TreeView_GetRoot(hwndTV),TVE_EXPAND);
TreeView_Select(hwndTV,currentLex,TVGN_CARET);
- SendDlgItemMessage(hwnd,IDC_STYLEEDIT,EM_LIMITTEXT,COUNTOF(lexDefault.Styles[0].szValue)-1,0);
+ SendDlgItemMessage(hwnd,IDC_STYLEEDIT,EM_LIMITTEXT, max(BUFSIZE_STYLE_VALUE, BUFZIZE_STYLE_EXTENTIONS)-1,0);
MakeBitmapButton(hwnd,IDC_PREVSTYLE,g_hInstance,IDB_PREV);
MakeBitmapButton(hwnd,IDC_NEXTSTYLE,g_hInstance,IDB_NEXT);
@@ -4561,7 +4556,7 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP
GetDlgItemText(hwnd,IDC_STYLEEDIT,pCurrentStyle->szValue,COUNTOF(pCurrentStyle->szValue));
else if (pCurrentLexer) {
- WCHAR szBuf[256] = { L'\0' };
+ WCHAR szBuf[BUFZIZE_STYLE_EXTENTIONS] = { L'\0' };
if (GetDlgItemText(hwnd, IDC_STYLEEDIT, szBuf, COUNTOF(szBuf)))
StringCchCopy(pCurrentLexer->szExtensions,COUNTOF(pCurrentLexer->szExtensions),szBuf);
}
@@ -4569,10 +4564,10 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP
// a lexer has been selected
if (!TreeView_GetParent(hwndTV,lpnmtv->itemNew.hItem))
{
- WCHAR wch[256] = { L'\0' };
+ WCHAR wch[max(BUFSIZE_STYLE_VALUE, BUFZIZE_STYLE_EXTENTIONS)] = { L'\0' };
GetDlgItemText(hwnd,IDC_STYLELABELS,wch,COUNTOF(wch));
- if (StrChr(wch,L'|')) *StrChr(wch,L'|') = 0;
+ if (StrChr(wch,L'|')) *StrChr(wch,L'|') = L'\0';
pCurrentStyle = 0;
pCurrentLexer = (PEDITLEXER)lpnmtv->itemNew.lParam;
@@ -4617,10 +4612,10 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP
// a style has been selected
else
{
- WCHAR wch[256] = { L'\0' };
+ WCHAR wch[BUFSIZE_STYLE_VALUE] = { L'\0' };
GetDlgItemText(hwnd,IDC_STYLELABELS,wch,COUNTOF(wch));
- if (StrChr(wch,L'|')) *StrChr(wch,L'|') = 0;
+ if (StrChr(wch,L'|')) *StrChr(wch,L'|') = L'\0';
pCurrentLexer = 0;
@@ -4737,7 +4732,7 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP
htiTarget = TreeView_GetDropHilight(hwndTV);
if (htiTarget)
{
- WCHAR tchCopy[256] = { L'\0' };
+ WCHAR tchCopy[max(BUFSIZE_STYLE_VALUE, BUFZIZE_STYLE_EXTENTIONS)] = { L'\0' };
TreeView_SelectDropTarget(hwndTV,NULL);
GetDlgItemText(hwnd,IDC_STYLEEDIT,tchCopy,COUNTOF(tchCopy));
TreeView_Select(hwndTV,htiTarget,TVGN_CARET);
@@ -4797,7 +4792,7 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP
case IDC_STYLEFONT:
if (pCurrentStyle)
{
- WCHAR tch[256] = { L'\0' };
+ WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' };
GetDlgItemText(hwnd,IDC_STYLEEDIT,tch,COUNTOF(tch));
if (Style_SelectFont(hwnd,tch,COUNTOF(tch),
StringCchCompareIX(pCurrentStyle->pszName,L"Default Style") == 0 ||
@@ -4815,7 +4810,7 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP
case IDC_STYLEFORE:
if (pCurrentStyle)
{
- WCHAR tch[256] = { L'\0' };
+ WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' };
GetDlgItemText(hwnd,IDC_STYLEEDIT,tch,COUNTOF(tch));
if (Style_SelectColor(hwnd,TRUE,tch,COUNTOF(tch))) {
SetDlgItemText(hwnd,IDC_STYLEEDIT,tch);
@@ -4831,7 +4826,7 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP
case IDC_STYLEBACK:
if (pCurrentStyle)
{
- WCHAR tch[256] = { L'\0' };
+ WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' };
GetDlgItemText(hwnd,IDC_STYLEEDIT,tch,COUNTOF(tch));
if (Style_SelectColor(hwnd,FALSE,tch,COUNTOF(tch))) {
SetDlgItemText(hwnd,IDC_STYLEEDIT,tch);
@@ -4864,7 +4859,7 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP
//case IDC_STYLEBOLD:
// if (pCurrentStyle)
// {
- // WCHAR tch[256] = { L'\0' };
+ // WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' };
// GetDlgItemText(hwnd,IDC_STYLEEDIT,tch,COUNTOF(tch));
// Style_StrSetAttribute(tch,COUNTOF(tch),L"bold",IsDlgButtonChecked(hwnd,IDC_STYLEBOLD));
// SetDlgItemText(hwnd,IDC_STYLEEDIT,tch);
@@ -4874,7 +4869,7 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP
//case IDC_STYLEITALIC:
// if (pCurrentStyle)
// {
- // WCHAR tch[256] = { L'\0' };
+ // WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' };
// GetDlgItemText(hwnd,IDC_STYLEEDIT,tch,COUNTOF(tch));
// Style_StrSetAttribute(tch,COUNTOF(tch),L"italic",IsDlgButtonChecked(hwnd,IDC_STYLEITALIC));
// SetDlgItemText(hwnd,IDC_STYLEEDIT,tch);
@@ -4884,7 +4879,7 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP
//case IDC_STYLEUNDERLINE:
// if (pCurrentStyle)
// {
- // WCHAR tch[256] = { L'\0' };
+ // WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' };
// GetDlgItemText(hwnd,IDC_STYLEEDIT,tch,COUNTOF(tch));
// Style_StrSetAttribute(tch,COUNTOF(tch),L"underline",IsDlgButtonChecked(hwnd,IDC_STYLEUNDERLINE));
// SetDlgItemText(hwnd,IDC_STYLEEDIT,tch);
@@ -4894,7 +4889,7 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP
//case IDC_STYLEEOLFILLED:
// if (pCurrentStyle)
// {
- // WCHAR tch[256] = { L'\0' };
+ // WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' };
// GetDlgItemText(hwnd,IDC_STYLEEDIT,tch,COUNTOF(tch));
// Style_StrSetAttribute(tch,COUNTOF(tch),L"eolfilled",IsDlgButtonChecked(hwnd,IDC_STYLEEOLFILLED));
// SetDlgItemText(hwnd,IDC_STYLEEDIT,tch);
@@ -4905,7 +4900,7 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP
{
if (HIWORD(wParam) == EN_CHANGE) {
int cr;
- WCHAR tch[256] = { L'\0' };
+ WCHAR tch[max(BUFSIZE_STYLE_VALUE, BUFZIZE_STYLE_EXTENTIONS)] = { L'\0' };
GetDlgItemText(hwnd,IDC_STYLEEDIT,tch,COUNTOF(tch));
@@ -5008,7 +5003,7 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP
void Style_ConfigDlg(HWND hwnd)
{
- WCHAR *StyleBackup[1024];
+ WCHAR* StyleBackup[NUMLEXERS * 64];
int c,cItems,i,iLexer;
// Backup Styles
diff --git a/src/Styles.h b/src/Styles.h
index f97102956..979aee729 100644
--- a/src/Styles.h
+++ b/src/Styles.h
@@ -16,6 +16,9 @@
#ifndef _NP3_STYLES_H_
#define _NP3_STYLES_H_
+#define BUFSIZE_STYLE_VALUE 256
+#define BUFZIZE_STYLE_EXTENTIONS 512
+
typedef struct _editstyle
{
#pragma warning(disable : 4201) // MS's Non-Std: Struktur/Union ohne Namen
@@ -27,7 +30,7 @@ typedef struct _editstyle
int rid;
WCHAR* pszName;
WCHAR* pszDefault;
- WCHAR szValue[256];
+ WCHAR szValue[BUFSIZE_STYLE_VALUE];
} EDITSTYLE, *PEDITSTYLE;
@@ -45,7 +48,7 @@ typedef struct _editlexer
int rid;
WCHAR* pszName;
WCHAR* pszDefExt;
- WCHAR szExtensions[256];
+ WCHAR szExtensions[BUFZIZE_STYLE_EXTENTIONS];
PKEYWORDLIST pKeyWords;
EDITSTYLE Styles[];
diff --git a/src/VersionEx.h b/src/VersionEx.h
index 5403b35dd..7e0a8aa4b 100644
--- a/src/VersionEx.h
+++ b/src/VersionEx.h
@@ -1,5 +1,5 @@
#define VERSION_MAJOR 2
#define VERSION_MINOR 17
-#define VERSION_REV 1016
-#define VERSION_BUILD 610
+#define VERSION_REV 1023
+#define VERSION_BUILD 632
#define SCINTILLA_VER 400