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

comment is move to the wrong place #22

Open
Arpple opened this issue Jul 14, 2018 · 2 comments
Open

comment is move to the wrong place #22

Arpple opened this issue Jul 14, 2018 · 2 comments
Labels

Comments

@Arpple
Copy link

Arpple commented Jul 14, 2018

running formatText on these lines

function Test()
    if a == 0 then
        print("1")

    -- a is one
    elseif a == 1 then
        print("2")
    end
end

result is

function Test()
    if a == 0 then
        -- a is one
        print("1")
    elseif a == 1 then
        print("2")
    end
end
@trixnz trixnz added the bug label Jul 31, 2018
@AgentOttsel
Copy link

AgentOttsel commented Oct 15, 2018

This also happens if you when you have a comment before the 'end' line of an if-else-end block.

Input:

if condition then
    doStuff()
else
    doOtherStuff()
    --comment
end

Output:

if condition then
    doStuff()
else
    --comment
    doOtherStuff()
end

@Arpple
Copy link
Author

Arpple commented Oct 17, 2018

another case I found
Input:

if 1 then
    doSomething()
    -- comment
end

Result:

if 1 then
    doSomething()
-- comment
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants