Lite-XL init problem
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    tolkien
    Posts: 519 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: 3092 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: 598 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,PowerBook G4 1.5,MacMini 1.5, PowerMac G5 2.7 died !!!
    My MOS ports
  • »19.06.22 - 16:39
    Profile Visit Website
  • Moderator
    Kronos
    Posts: 2307 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
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    tolkien
    Posts: 519 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: 3092 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
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    walkero
    Posts: 104 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
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    walkero
    Posts: 104 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
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    walkero
    Posts: 104 from 2006/3/1
    Hello everyone.
    I am working to release a new version of LiteXL and I need your help.
    As I am fixing that issue above, can you please tell me which Locale are you using, so to double check with it that is working fine?
  • »18.09.22 - 14:51
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 800 from 2007/10/23
    From: Gelsenkirchen,...
    That's the way it is: The locale "C" or "POSIX" is a portable locale; it exists on all conforming systems
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »19.09.22 - 18:12
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    walkero
    Posts: 104 from 2006/3/1
    Today I released the new version of LiteXL.
    You can find more details about it at https://ko-fi.com/post/LiteXL-2-0-3r3-released-B0B1FA7A9

    Please, let me know how it works for you guys.
  • »26.09.22 - 16:57
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    tolkien
    Posts: 519 from 2013/5/29
    Sorry but I have tried it and get the following error:

    Error: [string "local core..."]:29: attempt to concatenate local 'error_dir' (a nil value)
    stack traceback:
    Work:TXT/LiteXL2/data/core/style.lua:48: in main chunk
    [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
    MorphOS: PowerMac G5 - PowerBook G4 - MacMini.
    Classic: Amiga 1200/060 - A500 PiStorm
  • »26.09.22 - 18:54
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    beworld
    Posts: 598 from 2010/2/10
    From: FRANCE
    Just upload on morphos-storage :
    https://www.morphos-storage.net/?id=1805977

    @tolkien you can retest it ? and do not rename executable "lite" (i test to rename it and same error here)


    @all dev: Maybe on MorphOS, there is a function to find real executable name ?

    https://git.walkero.gr/walkero/lite-xl/src/branch/amiga-2.0/src/main.c#L60


    PS: maybe that : https://github.com/dcti/dnetc-client-base/blob/fee9ffa47351a5c71066ac9dbfa9cc740e54a8a0/common/util.cpp#L1032

    [ Edité par beworld 26.09.2022 - 22:18 ]
    IMac G5 2.1,PowerBook G4 1.5,MacMini 1.5, PowerMac G5 2.7 died !!!
    My MOS ports
  • »26.09.22 - 21:16
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    tolkien
    Posts: 519 from 2013/5/29
    Erase the old version and Unpack this new one.
    With this version I get:

    Error: Work:TXT/LiteXL2/data/core/common.lua:60: 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
    Error: [string "local core..."]:29: attempt to concatenate local 'error_dir' (a nilvalue)
    stack traceback:
    Work:TXT/LiteXL2/data/core/style.lua:48: in main chunk
    [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
    MorphOS: PowerMac G5 - PowerBook G4 - MacMini.
    Classic: Amiga 1200/060 - A500 PiStorm
  • »26.09.22 - 21:38
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    beworld
    Posts: 598 from 2010/2/10
    From: FRANCE
    getenv(HOME) ... have you HOME file on your ENV:

    Check : https://git.walkero.gr/walkero/lite-xl/src/branch/amiga-2.0/README_Amiga.md
    IMac G5 2.1,PowerBook G4 1.5,MacMini 1.5, PowerMac G5 2.7 died !!!
    My MOS ports
  • »26.09.22 - 21:59
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    tolkien
    Posts: 519 from 2013/5/29
    Yes. I created HOME env long time ago.

    I have deleted the litexl2 content in HOME dir but get the same error.
    MorphOS: PowerMac G5 - PowerBook G4 - MacMini.
    Classic: Amiga 1200/060 - A500 PiStorm
  • »26.09.22 - 22:11
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    walkero
    Posts: 104 from 2006/3/1
    @tolkien
    Thanks for testing it. Are you sure you downloaded the latest version and not the previous one? Because the error you mention is the one that has to do with the locale, which I think I fixed. If not, can you please let me know what locale prefs are you using, so I can try to reproduce it here?

    @all
    Please, do not rename the main binary, since this will fail. This is something I have on my todo list, to be fixed, but for now, it is hardcoded.

    @beworld
    Thank you for your recommendation. I will have a look, as I am already working on the next version, which brings a lot of nice features. But it will take some time until a new release is done.
  • »27.09.22 - 00:12
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    tolkien
    Posts: 519 from 2013/5/29
    @walkero
    Yes, pretty sure is the last version ( 2.0.3r3) but I have redownloaded it again with the same error.
    Im using Spanish locale if it is that what you are asking.
    MorphOS: PowerMac G5 - PowerBook G4 - MacMini.
    Classic: Amiga 1200/060 - A500 PiStorm
  • »27.09.22 - 18:00
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    walkero
    Posts: 104 from 2006/3/1
    @tolkien
    Thank you for the info. Will try to reproduce it and let you know how if I have something to test.
  • »28.09.22 - 11:59
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    tolkien
    Posts: 519 from 2013/5/29
    @walkero
    Thanks. I can do test all you need. Just PM if you want.
    MorphOS: PowerMac G5 - PowerBook G4 - MacMini.
    Classic: Amiga 1200/060 - A500 PiStorm
  • »28.09.22 - 14:25
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    walkero
    Posts: 104 from 2006/3/1
    @tolkien and everyone
    A new release of LiteXL is released today for MorphOS.
    Please have a look for more information on what is included at
    https://ko-fi.com/post/LiteXL-2-1-0r1-release-A0A4FLYNG

    There is a fix for the locale problem which I hope it will work for everyone.
    Let me know what you think.

    See you at the Amiga37 everyone.
  • »10.10.22 - 20:02
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    tolkien
    Posts: 519 from 2013/5/29
    Doing a fast testing and seems it works flawsly!
    Thanks so much Walkero for this nice work.
    MorphOS: PowerMac G5 - PowerBook G4 - MacMini.
    Classic: Amiga 1200/060 - A500 PiStorm
  • »10.10.22 - 20:25
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    walkero
    Posts: 104 from 2006/3/1
    That's the best news I heard guys. Thank you so much for testing it. Hope you enjoy it.
  • »10.10.22 - 20:38
    Profile Visit Website