GithubHelp home page GithubHelp logo

Comments (6)

fade2gray avatar fade2gray commented on June 1, 2024 1

The problem seems to be with using an opening parenthesis on the continuation line?

DllCall(() ;no indent
DllCall(
() ;continuation line indented
DllCall(()) ;no indent
DllCall(
()) ;continuation line indented

will format as

DllCall(() ;no indent
DllCall(
    () ;continuation line indented
    DllCall(()) ;no indent
    DllCall(
        ()) ;continuation line indented

If you make this a single line without a continuation, indentation doesn't occur to the rest of the code beneath it.
It's this opening parenthesis after the continuation that causes the problem StrLen(.

TaskName := "[RunAsTask] " A_ScriptName " @" SubStr( "000000000" DllCall( "NTDLL\RtlComputeCrc32", "Int",0, "WStr",CmdLine, "UInt",StrLen( CmdLine ) * 2, "UInt" ), -9 )

from ahkpp.

mark-wiemer avatar mark-wiemer commented on June 1, 2024 1

Cool. This is a big snippet though, and it took some time to narrow down the issue. For future reference, please use the formatting bug template with small snippets so they're easier to diagnose. Something like

foo(
(bar))
x := 1

as the unformatted input snippet would suffice.

from ahkpp.

mark-wiemer avatar mark-wiemer commented on June 1, 2024 1

Apologies for introducing this bug, I should've tested the newly-added functionality more comprehensively. Pushing a hotfix now, thanks for the prompt report

from ahkpp.

mark-wiemer avatar mark-wiemer commented on June 1, 2024 1

@fade2gray although your workaround is correct, such a long line of code is usually undesirable. I originally wrote my code with a specific format in mind:

foo(
    bar,
    baz,
    bop
)

that is, each arg on its own line, and the close paren on its own line as well. But code should be flexible and work with multiple styles whenever possible. The new release, 2.7.2, should be available in a few minutes.

from ahkpp.

FuPeiJiang avatar FuPeiJiang commented on June 1, 2024

for clarity, DllCall should be line separated

from ahkpp.

mark-wiemer avatar mark-wiemer commented on June 1, 2024

@FuPeiJiang your ahk_explorer script is now added as an automated test, should prevent stuff like this from happening again ๐Ÿ™‚
Add ahk-explorer test ยท mark-wiemer/vscode-autohotkey-plus-plus@76adb57

from ahkpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.