Skip to content

Auto-indent wants to sometimes use tab_size 4 no matter what the user setting is #56

Description

@ArttuLai

I have following configuration in Zed:

// settings.json
{
  "tab_size": 2
}

also tried this, which didn't help:

// settings.json
{
  "languages": {
    "Lua": {
      "tab_size": 2
    }
  }
}

However, auto-indent in Lua files sometimes acts like I have 4. For example, if I have my cursor at |:

local tab = {|}

Pressing <Enter> turns into (looking good so far):

local tab = {
··|
}

I type something (still looking good):

local tab = {
··a = 1,|
}

But after I press <Enter>, it indents the first line inside the table to 4:

local tab = {
····a = 1,
··|
}

Same goes for functions, if statements, etc:

local function fn()
··local a = 1|
end

<Enter>:

local function fn()
····local a = 1
··|
end

If I set tab_size to 4, there's no issue, because in that case, that's where you want the indents to go.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions