Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix padWithLinebreaks #4

Merged
merged 2 commits into from
Feb 25, 2019
Merged

Fix padWithLinebreaks #4

merged 2 commits into from
Feb 25, 2019

Conversation

krka
Copy link
Owner

@krka krka commented Feb 24, 2019

No description provided.

@InfusOnWoW
Copy link

So I went digging how exactly the ForAllIndentsAndPurposes code evolved inside WA.

The rev 17 to 18 was done in 502907976351f686044566b57b22205cf9771ab4, so use
$ git show 502907976351f686044566b57b22205cf9771ab4 -w in the WeakAuras repository to see it properly.

That diff is a bit hard to read, as it is 90% whitespace cleanup, there's three non whitespace changes in there:

  • defaultTabWidth and defaultColorTable are moved to a place before they are actually used (I think)
  • the function nextToken is made local
  • tokenIndentation is made local

The rev 18 to 19 change is in 8dfe12489869ad6628b18172bc035ceb25c9e076, which apart from trailing whitespace fixes, also added a:
-- GLOBALS: IndentationLib line
for linting purposes

There's a change in 2566fc8a259a7a773171e6547354a3b7d9e8ef8f, which changed that line to -- luacheck: globals IndentationLib wihtout changing the rev number.

Next is 7c4ad0cd701c49bb97eaf7ced8bc6c920d9b012a, which bumps the rev from 19 to 20, it changes the character that is used to store the carret position, see WeakAuras/WeakAuras2#971 for context.

In 69f7ce6611ffdee0c895ae8603163e8d0f0e9572 the revison changed from 20 to 21: The unicode character was again changed to something from the private use area.

indent.lua Outdated
if stringbyte(code, len - 1) == linebreak then
return code, false
local linebreakcount = 0
while len > 0 or linebreakcount < 2 do
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it should be and instead of or here

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch - fixed!

@krka krka merged commit 2f18f11 into master Feb 25, 2019
@krka krka deleted the krka/linebreaks branch February 25, 2019 17:21
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.

None yet

3 participants