Skip to content

Add the disable-next-line instruction to disable formatting for the next line#222

Merged
CppCXY merged 1 commit intoCppCXY:masterfrom
wjiec:feat/disable-next-line
Feb 25, 2026
Merged

Add the disable-next-line instruction to disable formatting for the next line#222
CppCXY merged 1 commit intoCppCXY:masterfrom
wjiec:feat/disable-next-line

Conversation

@wjiec
Copy link
Contributor

@wjiec wjiec commented Feb 23, 2026

This PR introduces a new formatting instruction ---@format disable-next-line.

When there are too many statements on a single line or it is a large code block, ---@format disable-next may not meet the requirements, for example, the following code:

return {
    ---@format disable-next
    foo =  1, bar =  2, -- after formatting, it will become `foo = 1,bar = 2`.

    ---@format disable-next
    config = function( opts )
        -- The function body will not be formatted.
        return {
            foo =  1,
            bar =  2,
        }
    end,
}

@CppCXY CppCXY merged commit 9f46258 into CppCXY:master Feb 25, 2026
3 of 4 checks passed
@wjiec wjiec deleted the feat/disable-next-line branch February 25, 2026 09:50
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.

2 participants