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

Nested one command code flow control + Workaround #255

Closed
kyklish opened this issue Oct 15, 2022 · 0 comments · Fixed by #261
Closed

Nested one command code flow control + Workaround #255

kyklish opened this issue Oct 15, 2022 · 0 comments · Fixed by #261
Assignees
Labels
bug something isn't working formatter code formatter issues

Comments

@kyklish
Copy link
Contributor

kyklish commented Oct 15, 2022

Description

Some commands cause the next line to be indented. For example:

if (true)
    MsgBox
Loop % n
    SoundBeep

Such code will be well formatted.

However, the formatter doesn't work with nested commands.

Unformatted input snippet

if (true)
if (true)
MsgBox
MsgBox

Expected formatted output snippet

if (true)
    if (true)
        MsgBox
MsgBox

Actual formatted output snippet

if (true)
    if (true)
    MsgBox
MsgBox

Workaround

As a workaround, use braces:

if (true) {
    if (true)
        MsgBox
}
MsgBox
@kyklish kyklish added bug something isn't working formatter code formatter issues labels Oct 15, 2022
@mark-wiemer mark-wiemer moved this to To do in AHK++ Oct 15, 2022
@kyklish kyklish changed the title Nested one command code flow control Nested one command code flow control + Workaround Oct 16, 2022
mark-wiemer pushed a commit that referenced this issue Nov 22, 2022
Co-authored-by: Mark Wiemer <7833360+mark-wiemer@users.noreply.github.com>
Closes #255
Repository owner moved this from To do to Done in AHK++ Nov 22, 2022
mark-wiemer added a commit that referenced this issue Nov 22, 2022
## 3.1.0 - 2022-11-21 🦃

Compiler:

-   New compiler options in settings: Choose base file, file icon, and "use [MPRESS](https://www.autohotkey.com/mpress/mpress_web.htm)"
-   Add "Compiler GUI" command in context menu to use the AHK GUI when compiling

Snippets:

-   Update snippets for AHK 1.1.35.00 and fix broken `InStr()` snippet ([#263](#263))

Grammar: Fix `#Requires` not being recognized ([#268](#268))

Editor: New AHK file icon (green square with white H)

Debugger: Minor debugger improvements

Formatter: Close the following bugs:

    -   Formatter incorrectly indents object literals ([#184](#184), [#222](#222))
    -   Nested one command code flow control ([#255](#255))

Miscellaneous:

-   Extension should start up faster
@mark-wiemer mark-wiemer mentioned this issue Nov 22, 2022
mark-wiemer pushed a commit to cweijan/autohotkey-plus that referenced this issue Nov 23, 2022
AHK++ PR `#261`

Co-authored-by: Mark Wiemer <7833360+mark-wiemer@users.noreply.github.com>
Closes mark-wiemer/ahkpp#255
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working formatter code formatter issues
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants