Skip to content

Commit

Permalink
Add VBScript into "Visual Basic" scheme menu.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Nov 6, 2024
1 parent 165eb9d commit 3343605
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions locale/de/Notepad4.rc
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ BEGIN
BEGIN
MENUITEM "&Visual Basic", IDM_LEXER_VBNET
MENUITEM "&Office VBA", IDM_LEXER_VBA
MENUITEM "VB&Script", IDM_LEXER_VBS
END
POPUP "&XML Dokument"
BEGIN
Expand Down
1 change: 1 addition & 0 deletions locale/fr/Notepad4.rc
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ BEGIN
BEGIN
MENUITEM "&Visual Basic", IDM_LEXER_VBNET
MENUITEM "&Office VBA", IDM_LEXER_VBA
MENUITEM "VB&Script", IDM_LEXER_VBS
END
POPUP "Document XML"
BEGIN
Expand Down
1 change: 1 addition & 0 deletions locale/it/Notepad4.rc
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ BEGIN
BEGIN
MENUITEM "&Visual Basic", IDM_LEXER_VBNET
MENUITEM "&Office VBA", IDM_LEXER_VBA
MENUITEM "VB&Script", IDM_LEXER_VBS
END
POPUP "Documento &XML"
BEGIN
Expand Down
1 change: 1 addition & 0 deletions locale/ja/Notepad4.rc
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ BEGIN
BEGIN
MENUITEM "&Visual Basic", IDM_LEXER_VBNET
MENUITEM "&Office VBA", IDM_LEXER_VBA
MENUITEM "VB&Script", IDM_LEXER_VBS
END
POPUP "XML文書(&X)"
BEGIN
Expand Down
1 change: 1 addition & 0 deletions locale/ko/Notepad4.rc
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ BEGIN
BEGIN
MENUITEM "&Visual Basic", IDM_LEXER_VBNET
MENUITEM "&Office VBA", IDM_LEXER_VBA
MENUITEM "VB&Script", IDM_LEXER_VBS
END
POPUP "XML 문서(&X)"
BEGIN
Expand Down
1 change: 1 addition & 0 deletions locale/pt-BR/Notepad4.rc
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ BEGIN
BEGIN
MENUITEM "&Visual Basic", IDM_LEXER_VBNET
MENUITEM "&Office VBA", IDM_LEXER_VBA
MENUITEM "VB&Script", IDM_LEXER_VBS
END
POPUP "&XML Document"
BEGIN
Expand Down
1 change: 1 addition & 0 deletions locale/ru/Notepad4.rc
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ BEGIN
BEGIN
MENUITEM "&Visual Basic", IDM_LEXER_VBNET
MENUITEM "&Office VBA", IDM_LEXER_VBA
MENUITEM "VB&Script", IDM_LEXER_VBS
END
POPUP "&XML-документ"
BEGIN
Expand Down
1 change: 1 addition & 0 deletions locale/zh-Hans/Notepad4.rc
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ BEGIN
BEGIN
MENUITEM "&Visual Basic", IDM_LEXER_VBNET
MENUITEM "&Office VBA", IDM_LEXER_VBA
MENUITEM "VB&Script", IDM_LEXER_VBS
END
POPUP "&XML 文档"
BEGIN
Expand Down
1 change: 1 addition & 0 deletions locale/zh-Hant/Notepad4.rc
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ BEGIN
BEGIN
MENUITEM "&Visual Basic", IDM_LEXER_VBNET
MENUITEM "&Office VBA", IDM_LEXER_VBA
MENUITEM "VB&Script", IDM_LEXER_VBS
END
POPUP "&XML 文件"
BEGIN
Expand Down
1 change: 1 addition & 0 deletions src/Notepad4.rc
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ BEGIN
BEGIN
MENUITEM "&Visual Basic", IDM_LEXER_VBNET
MENUITEM "&Office VBA", IDM_LEXER_VBA
MENUITEM "VB&Script", IDM_LEXER_VBS
END
POPUP "&XML Document"
BEGIN
Expand Down
9 changes: 7 additions & 2 deletions src/Styles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1444,10 +1444,9 @@ void Style_SetLexer(PEDITLEXER pLexNew, BOOL bLexerChanged) noexcept {
} break;

case NP2LEX_VBSCRIPT:
dialect = 2; // see LexVB.cxx
break;
case NP2LEX_VISUALBASIC: {
static_assert(IDM_LEXER_VBA - IDM_LEXER_VBNET == 1);
static_assert(IDM_LEXER_VBS - IDM_LEXER_VBNET == 2);
dialect = np2LexLangIndex - IDM_LEXER_VBNET;
} break;
}
Expand Down Expand Up @@ -2902,6 +2901,9 @@ void Style_SetLexerByLangIndex(int lang) noexcept {
case IDM_LEXER_VBA:
pLex = &lexVisualBasic;
break;
case IDM_LEXER_VBS:
pLex = &lexVBScript;
break;

// XML Document
case IDM_LEXER_XML:
Expand Down Expand Up @@ -2986,6 +2988,9 @@ void Style_UpdateSchemeMenu(HMENU hmenu) noexcept {
case NP2LEX_VISUALBASIC:
lang = IDM_LEXER_VBNET;
break;
case NP2LEX_VBSCRIPT:
lang = IDM_LEXER_VBS;
break;
// XML Document
case NP2LEX_XML:
lang = IDM_LEXER_XML;
Expand Down
5 changes: 3 additions & 2 deletions src/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -867,9 +867,10 @@
// Visual Basic
#define IDM_LEXER_VBNET 40733
#define IDM_LEXER_VBA 40734
#define IDM_LEXER_VBS 40735
// individual
#define IDM_LEXER_APACHE 40735
#define IDM_LEXER_LEXER_COUNT 40736
#define IDM_LEXER_APACHE 40736
#define IDM_LEXER_LEXER_COUNT 40737

#define IDS_ERR_LOADFILE 50000
#define IDS_ERR_SAVEFILE 50001
Expand Down

0 comments on commit 3343605

Please sign in to comment.