Skip to content

Lua Tidying#841

Open
warmCabin wants to merge 34 commits into
TASEmulators:masterfrom
warmCabin:lua-recents-fix
Open

Lua Tidying#841
warmCabin wants to merge 34 commits into
TASEmulators:masterfrom
warmCabin:lua-recents-fix

Conversation

@warmCabin
Copy link
Copy Markdown

@warmCabin warmCabin commented May 25, 2026

I wanted to fix some Lua issues I've dealt with over the years. I kept working off of #802 because I am lazy. Just ignore any palette-related stuff for now, I'll rebase eventually.

  • Lua command line args weren't always getting passed. I made sure to read them in the following circumstances (Win32 only; SDL/Qt still needs to be investigated):
    • Recents menu
    • Main window dropfiles event
    • Shift+L thing
    • Main window context menu
    • Loaded from command line; to that end, I've created a new -luaargs argument.
  • Tidy up the Win32 Lua console window
    • Fix some awkward resizing behavior
    • Clean up the reentrant WM_CLOSE/IDCANCEL flow
    • Make it so IDOK (pressing enter) runs the script instead of closing the window
    • Make a button to clear console instead of a menu item
  • Properly tokenize arguments according to the Lua spec
    • This includes a compatibility mode toggle just in case anyone else on the planet actually uses these
    • I didn't implement any checkboxes in the SDL/Qt drivers, so compatibility mode is on by default for them
  • Replace "\n" with "\r\n" when printing to Win32 console window
  • Separate print() arguments with tabs, not spaces (all frontends)

I provided stubs in the Qt drivers, so the SDL/Qt builds at least still work.

warmCabin added 21 commits May 19, 2026 03:29
Just want to see what happens. If the performance sucks, I'll try it with 5
or 6 bits. If the difference is negligible, I'll remove it properly.
I added this for testing purposes; you might find it useful, too. I imagine
I'm going to revert this before merging.
* set a minimum track size to prevent controls from overlapping

* alter the RedrawWindow call in WM_SIZE to update children
  This prevents a stale canvas hall-of-mirrors effect

* make IDOK run the script instead of closing the window

* clean up weird reentrant IDCANCEL/WM_CLOSE flow
  Shoutouts to that commented out goto!
@warmCabin warmCabin changed the title Lua Arguments Fix Lua Tidying May 25, 2026
@warmCabin
Copy link
Copy Markdown
Author

FREE AT LAST! Everything's working again. The Qt build keeps timing out for whatever reason, but when it doesn't, it works. The Mac build is back to failing with that "/bin/sh: -c: line 0: syntax error near unexpected token `>'" error.

@warmCabin
Copy link
Copy Markdown
Author

I gave up trying to fix the Mac builds. I have a couple more Lua ideas I want to explore, but I'm going to call it here for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant