Skip to content

Indenting and new lines and other things I don't understand #204

@roygbyte

Description

@roygbyte

Hello Earthlings! I am trying to have my Lua code formatted like this:

local subscription = FeedSubscription:new({
    id = subscription_results.subscription_id
})

But instead, I get this:

local subscription = FeedSubscription:new({
        id = subscription_results.subscription_id
})

The idea here being that after a {, and moving to a new line, it would be oh so great if the indents are not doubled up (or whatever is happening.)

Not being very proficient with EmacsLisp, I've nonetheless tried to hack my way through this package to try to achieve my desired indentation. I didn't get very far.

Does anyone know what bits of the code I should be looking at for achieving this outcome? My best guess is that it has something to do with this code:

lua-mode/lua-mode.el

Lines 1572 to 1576 in 3e783c9

(cons 'relative (if (nth 2 (match-data))
;; beginning of a block matched
lua-indent-level
;; end of a block matched
(- lua-indent-level))))))

But that's all I know!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions