Lite-XL init problem
  • Order of the Butterfly
    Order of the Butterfly
    tolkien
    Posts: 439 from 2013/5/29
    Walkero with the help of Beworld has released the text editor LITE_XL for MorphOS too.

    Problem is that when I try to run it shows an error:

    Code:
    Error: Work:TXT/LiteXL2/data/core/common.lua:61: attempt to perform arithmetic on astring value
    stack traceback:
    [C]: in function 'require'
    Work:TXT/LiteXL2/data/core/init.lua:5: in main chunk
    [C]: in function 'require'
    [string "local core..."]:10: in function <[string "local core..."]:2>
    [C]: in function 'xpcall'
    [string "local core..."]:2: in main chunk


    Can anyone try it to know if is an own fault?



    [ Editado por tolkien 19.06.2022 - 16:47 ]
    MorphOS: PowerMac G5 - PowerBook G4 - MacMini.
    Classic: Amiga 1200/060 - A500 PiStorm
  • »19.06.22 - 15:46
    Profile
  • MorphOS Developer
    jacadcaps
    Posts: 2650 from 2003/3/5
    From: Canada
    I believe it’s a bug in the lua script. Given that walkero has modified the file I’m quite sure you need to report the bug to him. Looking at it he likely does not setup locales correctly, but I’m just guessing…
  • »19.06.22 - 16:10
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    beworld
    Posts: 513 from 2010/2/10
    From: FRANCE
    data/core/common.lua line 61

    replace
    Code:

    a = (f() or "1.0"):gsub("%.", ",") * 0xff -- This is necessary for Lua 5.2 on MOS
    -- having issues with float numbers having
    -- a dot instead of comma


    by

    Code:
    a = (f() or 1) * 0xff


    Dont know why Walkero edit that ?!, but working here, Walkero ?
    IMac G5 2.1,PowerMac 2.7,PowerBook 1.5
    My MOS ports
  • »19.06.22 - 16:39
    Profile Visit Website
  • Moderator
    Kronos
    Posts: 2064 from 2003/2/24
    Well the comment in the code suggest that is indeed an issue with locale (not the Amiga kind) which swaps the meaning of . and , in numbers.

    I'd guess that the old code will just run fine in countries that use . to in floats but will fail in those that use ,
  • »19.06.22 - 17:00
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    tolkien
    Posts: 439 from 2013/5/29
    Quote:

    beworld escribió:
    data/core/common.lua line 61

    replace
    Code:

    a = (f() or "1.0"):gsub("%.", ",") * 0xff -- This is necessary for Lua 5.2 on MOS
    -- having issues with float numbers having
    -- a dot instead of comma


    by

    Code:
    a = (f() or 1) * 0xff


    Dont know why Walkero edit that ?!, but working here, Walkero ?


    Have done that but with no success. It shows the same error.
    Changing that with a = 1 it runs. Obviously it is a fucking hack. :/


    [ Editado por tolkien 19.06.2022 - 20:21 ]
    MorphOS: PowerMac G5 - PowerBook G4 - MacMini.
    Classic: Amiga 1200/060 - A500 PiStorm
  • »19.06.22 - 19:06
    Profile
  • MorphOS Developer
    jacadcaps
    Posts: 2650 from 2003/3/5
    From: Canada
    Quote:

    Kronos wrote:
    I'd guess that the old code will just run fine in countries that use . to in floats but will fail in those that use ,


    Which simply means that the *app* needs to set the right locale in its startup code.
  • »19.06.22 - 19:12
    Profile Visit Website
  • Butterfly
    Butterfly
    walkero
    Posts: 80 from 2006/3/1
    I am so sorry I haven't replied before. Thank you for testing the first release of LiteXL.

    Actually that is a problem I have on one of my systems, and tried to fix it, but it seems it has to do with the system locale.
    On the same system I tested the lua binary and lua 5.3 seems to not have that issue (always treats dot as a float), but lua 5.2 does. Unfortunately that LiteXL version requires lua 5.2. Also, the lua 5.3 compiled with 5.2 compatibility has the same issue as well.

    I will investigate more on a fix for the next release. Thank you for reporting this.

    Hope LiteXL is useful for you guys. It is the first release, and issues are going to be ironed out.
  • »26.06.22 - 20:49
    Profile Visit Website
  • Butterfly
    Butterfly
    walkero
    Posts: 80 from 2006/3/1
    @jacadcaps
    Absolutely. This is going to be in the next update. Thank you for that link.
  • »27.06.22 - 14:25
    Profile Visit Website