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.6k stars 519 forks source link

output window message on start up #1100

Closed qgenesist closed 3 years ago

qgenesist commented 3 years ago

Error while processing configuration file: 'src/editor/package.lua:415: attempt to index field 'frame' (a nil value)'. Error while processing configuration file: 'src/editor/package.lua:415: attempt to index field 'frame' (a nil value)'.

this appears twice as above in the output window when I start ZB I am at 1.90 and w10 64 bit

pkulchenko commented 3 years ago

There is likely something wrong with the content of the config file (user.lua), as it looks like it's considering package.lua to be a config file (which it normally shouldn't).

qgenesist commented 3 years ago

i have searched and cannot find anything amiss --[[-- Use this file to specify User preferences. Review examples or check online documentation for details. --]]-- filetree.showchanges = true staticanalyzer.infervalue = true default.usecurrentextension = true console.fontname = 'Courier New' console.fontsize = 10 ide:GetEditor():ConvertEOLs(ide:GetEditor():GetEOLMode()) ide:GetEditor():SetViewEOL(1) editor.defaulteol = wxstc.wxSTC_EOL_CRLF editor.indentguide = wxstc.wxSTC_IV_LOOKBOTH editor.wrapindentmode = wxstc.wxSTC_WRAPINDENT_FIXED editor.fontname = 'Courier New' editor.fontsize = 12 editor.checkeol = true editor.usewrap = true editor.autoreload = true editor.specmap.fh_lua = 'lua' editor.specmap.wlua = 'lua' editor.smartindent = true editor.tabwidth = 2 editor.usetabs = false

pkulchenko commented 3 years ago

It's these two lines:

ide:GetEditor():ConvertEOLs(ide:GetEditor():GetEOLMode())
ide:GetEditor():SetViewEOL(1)

You can't call GetEditor() from the config file, as it's evaluated way before a new editor is even created, which triggers the error you see.

You can use something like this instead:

package {
  onEditorLoad = function(package, editor)
    editor:ConvertEOLs(editor:GetEOLMode())
    editor:SetViewEOL(1)
  end
}