pkulchenko / ZeroBraneStudio

Lightweight Lua-based IDE for Lua with code completion, syntax highlighting, live coding, remote debugger, and code analyzer; supports Lua 5.1, 5.2, 5.3, 5.4, LuaJIT and other Lua interpreters on Windows, macOS, and Linux
http://studio.zerobrane.com/
Other
2.61k stars 519 forks source link

Regularly : wxLua Runtine Error : GetCodePage(a nil value) #1077

Closed CryptoLogiq closed 4 years ago

CryptoLogiq commented 4 years ago

Hello,

I regularly have this "getCodePage" error :

GitHub Logo(url)

This error pop when try saving, sometimes it goes, sometimes not...

When this error pop, i loose my session of ZeroBrane.

anyone has any idea of ​​the problem?

Thank's.

CryptoLogiq.

pkulchenko commented 4 years ago

What OS are you running it on and what does About screen in the IDE show?

Also, can you include the screenshot of the error in the message (attach it to github post), as the discord link is likely to disappear with time.

pkulchenko commented 4 years ago

@CryptoLogiq, thank you for the report. See if the following patch fixes the issue:

diff --git a/src/editor/gui.lua b/src/editor/gui.lua
index 7e2e7fe6..ffd7f68c 100644
--- a/src/editor/gui.lua
+++ b/src/editor/gui.lua
@@ -307,6 +307,10 @@ local function createNotebook(frame)

       PackageEventHandle("onMenuEditorTab", menu, notebook, event, notebook:GetPageIndex(selection))

+      if selection:GetClassInfo():GetClassName() == "wxStyledTextCtrl" then
+        selection = selection:DynamicCast("wxStyledTextCtrl")
+      end
+
       -- popup statuses are not refreshed on Linux, so do it manually
       if ide.osname == "Unix" then UpdateMenuUI(menu, notebook) end
       notebook:PopupMenu(menu)
CryptoLogiq commented 4 years ago

What OS are you running it on and what does About screen in the IDE show?

Also, can you include the screenshot of the error in the message (attach it to github post), as the discord link is likely to disappear with time.

Hi, i'm on W10 X64 Pro LTSC build 1809

pkulchenko commented 4 years ago

Thank you; I've been able to reproduce the issue. Let me know if the patch works for you.

CryptoLogiq commented 4 years ago

Crach caused by old packages used in 1.80... i remove all and no problems now...

CryptoLogiq commented 4 years ago

packages list removed :

CryptoLogiq commented 4 years ago

https://github.com/pkulchenko/ZeroBranePackage/blob/master/autoindent.lua

https://github.com/pkulchenko/ZeroBranePackage/blob/master/tasks.lua

https://github.com/pkulchenko/ZeroBranePackage/blob/master/wordwrapmenu.lua

pkulchenko commented 4 years ago

I could reproduce the issue without the plugins and it's fixed by the applied patch for me. I pushed the changes, so let me know if you still see the error when the plugins are used.

CryptoLogiq commented 4 years ago

preview it's back =) you will see the problem now =)

but how to get the fix ?

pkulchenko commented 4 years ago

@CryptoLogiq, is this with the applied fix? Are you running the latest code from the master branch? It doesn't look like from the stack trace that you have the patch applied. Let me know if you can try it on the latest master branch.

CryptoLogiq commented 4 years ago

ok this is the master branch, I will test then (because we see the last update at 17 days in the main page, and I thought you had another dev branch ...)

Indeed when I went into the details of the Master, I see a last update which dates from 2 days, so I will try with your repair now =)