Skip to content

Commit

Permalink
Display code with numbers in Lua and Perl
Browse files Browse the repository at this point in the history
While these are being implemented, it helps to see the line numbers to
match the errors being generated.
  • Loading branch information
Randalphwa committed Nov 28, 2024
1 parent e4f3ae3 commit 4051736
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/panels/code_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ CodeDisplay::CodeDisplay(wxWindow* parent, GenLang panel_type) : CodeDisplayBase
}
else if (panel_type == GEN_LANG_LUA)
{
m_scintilla->SetMarginType(0, wxSTC_MARGIN_NUMBER);
m_scintilla->SetMarginWidth(0, m_scintilla->TextWidth(wxSTC_STYLE_LINENUMBER, "_999"));

m_scintilla->SetLexer(wxSTC_LEX_LUA);
// On Windows, this saves converting the UTF8 to UTF16 and then back to ANSI.
m_scintilla->SendMsg(SCI_SETKEYWORDS, 0, (wxIntPtr) g_lua_keywords);
Expand Down Expand Up @@ -333,6 +336,9 @@ CodeDisplay::CodeDisplay(wxWindow* parent, GenLang panel_type) : CodeDisplayBase
}
else if (panel_type == GEN_LANG_PERL)
{
m_scintilla->SetMarginType(0, wxSTC_MARGIN_NUMBER);
m_scintilla->SetMarginWidth(0, m_scintilla->TextWidth(wxSTC_STYLE_LINENUMBER, "_999"));

m_scintilla->SetLexer(wxSTC_LEX_PERL);
// On Windows, this saves converting the UTF8 to UTF16 and then back to ANSI.
m_scintilla->SendMsg(SCI_SETKEYWORDS, 0, (wxIntPtr) g_perl_keywords);
Expand Down

0 comments on commit 4051736

Please # to comment.