From 40517366827e2b8d7e0f7c4dc0dfd0be8679e8eb Mon Sep 17 00:00:00 2001 From: Randalphwa <38287198+Randalphwa@users.noreply.github.com> Date: Wed, 27 Nov 2024 20:37:10 -0800 Subject: [PATCH] Display code with numbers in Lua and Perl While these are being implemented, it helps to see the line numbers to match the errors being generated. --- src/panels/code_display.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/panels/code_display.cpp b/src/panels/code_display.cpp index 6644af923..b15cdce68 100644 --- a/src/panels/code_display.cpp +++ b/src/panels/code_display.cpp @@ -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); @@ -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);