immerrr / lua-mode

Emacs major mode for editing Lua
http://immerrr.github.io/lua-mode
GNU General Public License v3.0
316 stars 74 forks source link

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

Open roygbyte opened 1 year ago

roygbyte commented 1 year ago

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:

https://github.com/immerrr/lua-mode/blob/3e783c93aa8a3d3ca985686438aa8d140cbddae6/lua-mode.el#L1572-L1576

But that's all I know!