Merge branch 'Development_0516' into DevMultiLingual

This commit is contained in:
Rainer Kottenhoff 2018-05-16 09:13:55 +02:00
commit d5b078bd46
2 changed files with 14 additions and 23 deletions

View File

@ -6274,9 +6274,7 @@ LRESULT MsgNotify(HWND hwnd,WPARAM wParam,LPARAM lParam)
return true;
case STATUS_2ND_DEF:
if (!Style_IsCurLexerStandard()) {
PostMessage(hwnd, WM_COMMAND, MAKELONG(IDM_VIEW_USE2NDDEFAULT, 1), 0);
}
PostMessage(hwnd, WM_COMMAND, MAKELONG(IDM_VIEW_USE2NDDEFAULT, 1), 0);
return true;
case STATUS_LEXER:
@ -8119,25 +8117,16 @@ static void __fastcall _UpdateStatusbarDelayed(bool bForceRedraw)
}
// ------------------------------------------------------
static int s_iUse2ndDefault = -1;
int iUse2ndDefault = Style_IsCurLexerStandard() ? 0 : (Style_GetUse2ndDefault() ? 2 : 1);
if (s_iUse2ndDefault != iUse2ndDefault) {
switch (iUse2ndDefault) {
case 0:
StringCchPrintf(tchStatusBar[STATUS_2ND_DEF], txtWidth, L"%s", g_mxStatusBarPrefix[STATUS_2ND_DEF]);
break;
case 1:
StringCchPrintf(tchStatusBar[STATUS_2ND_DEF], txtWidth, L"%sSTD", g_mxStatusBarPrefix[STATUS_2ND_DEF]);
break;
case 2:
static bool s_bUse2ndDefault = -1;
bool const bUse2ndDefault = Style_GetUse2ndDefault();
if (s_bUse2ndDefault != bUse2ndDefault)
{
if (bUse2ndDefault)
StringCchPrintf(tchStatusBar[STATUS_2ND_DEF], txtWidth, L"%s2ND", g_mxStatusBarPrefix[STATUS_2ND_DEF]);
break;
default:
StringCchPrintf(tchStatusBar[STATUS_2ND_DEF], txtWidth, L"%sXXX", g_mxStatusBarPrefix[STATUS_2ND_DEF]);
break;
}
s_iUse2ndDefault = iUse2ndDefault;
else
StringCchPrintf(tchStatusBar[STATUS_2ND_DEF], txtWidth, L"%sSTD", g_mxStatusBarPrefix[STATUS_2ND_DEF]);
s_bUse2ndDefault = bUse2ndDefault;
bIsUpdateNeeded = true;
}
// ------------------------------------------------------

View File

@ -3371,11 +3371,10 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew)
// first set standard lexer's default values
if (IsLexerStandard(pLexNew)) {
g_pLexCurrent = pLexNew;
EnableCmd(GetMenu(g_hwndMain), IDM_VIEW_USE2NDDEFAULT, false);
Style_SetUse2ndDefault(g_pLexCurrent == &lexStandard2nd); // sync
}
else {
g_pLexCurrent = GetCurrentStdLexer();
EnableCmd(GetMenu(g_hwndMain), IDM_VIEW_USE2NDDEFAULT, true);
}
const WCHAR* const wchStandardStyleStrg = g_pLexCurrent->Styles[STY_DEFAULT].szValue;
@ -4488,6 +4487,9 @@ void Style_ToggleUse2ndDefault(HWND hwnd)
{
bool const use2ndDefStyle = Style_GetUse2ndDefault();
Style_SetUse2ndDefault(use2ndDefStyle ? false : true); // swap
if (IsLexerStandard(g_pLexCurrent)) {
g_pLexCurrent = Style_GetUse2ndDefault() ? &lexStandard2nd : &lexStandard; // sync
}
Style_SetLexer(hwnd,g_pLexCurrent);
}