mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-28 21:02:59 +08:00
+ fix: bug on switching between 1st and 2nd standard lexers
This commit is contained in:
parent
fca7de523d
commit
947797a501
@ -4189,6 +4189,9 @@ void Style_ToggleUse2ndDefault(HWND hwnd)
|
||||
{
|
||||
BOOL use2ndDefStyle = Style_GetUse2ndDefault();
|
||||
Style_SetUse2ndDefault(use2ndDefStyle ? FALSE : TRUE); // swap
|
||||
if (IsLexerStandard(g_pLexCurrent)) {
|
||||
g_pLexCurrent = Style_GetUse2ndDefault() ? &lexStandard2nd : &lexStandard;
|
||||
}
|
||||
Style_SetLexer(hwnd,g_pLexCurrent);
|
||||
}
|
||||
|
||||
@ -6004,13 +6007,15 @@ INT_PTR CALLBACK Style_SelectLexerDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPAR
|
||||
lvi.mask = LVIF_PARAM;
|
||||
for (i = 0; i < lvItems; i++) {
|
||||
lvi.iItem = i;
|
||||
ListView_GetItem(hwndLV,&lvi);;
|
||||
if (StringCchCompareX(((PEDITLEXER)lvi.lParam)->pszName,g_pLexCurrent->pszName) == 0) {
|
||||
ListView_GetItem(hwndLV,&lvi);
|
||||
if (StringCchCompareX(((PEDITLEXER)lvi.lParam)->pszName, g_pLexCurrent->pszName) == 0)
|
||||
{
|
||||
ListView_SetItemState(hwndLV,i,LVIS_FOCUSED|LVIS_SELECTED,LVIS_FOCUSED|LVIS_SELECTED);
|
||||
ListView_EnsureVisible(hwndLV,i,FALSE);
|
||||
if (g_iDefaultLexer == i) {
|
||||
CheckDlgButton(hwnd,IDC_DEFAULTSCHEME,BST_CHECKED);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user