fix(widget.cal): Lua 5.5 read-only for-loop variable - #568
Open
megvadulthangya wants to merge 1 commit into
Open
fix(widget.cal): Lua 5.5 read-only for-loop variable#568megvadulthangya wants to merge 1 commit into
megvadulthangya wants to merge 1 commit into
Conversation
…a 5.5 Lua 5.5 makes for-loop variables read-only, so reassigning the loop variable `x` inside the calendar loop is now an error. Use a separate local variable `x_str` for the formatted string.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In Lua 5.5, for-loop variables are now read-only (see Lua 5.5 changes).
The calendar widget (
cal.lua) was reassigning the loop variablexinside the loop body, causing a crash:This prevented awesome from starting when built with Lua 5.5.
Fix
Inside
cal.build, the loop variablexis now kept read-only; its formatted string representation is assigned to a separate local variablex_strinstead.This is the only line that required modification. No other files were changed.
Testing
lainandpowerarrow-darktheme.Related
Replaces the previous (closed) PR which contained unnecessary changes.
This minimal fix addresses exactly the root cause as pointed out by @Aire-One.