Skip to content

Lack of automatic indentation edge case in Gleam files #3

Open
@JosephTLyons

Description

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

In most functions, Zed adds the correct indentation when putting the cursor after the { and adding a newline

fn write(file: File, text: String) {
| <- cursor here
  io.println("\"" <> text <> "\" -> " <> file.path)
}

However, for this edge case, indentation is not applied:

fn write_to_file(
  path: String,
  file_actions: fn(File) -> Nil,
) -> Result(Nil, Nil) {
| <- cursor here
  use file <- result.try(open_file(path))
  file_actions(file)
  close_file(file)
  Ok(Nil)
}

Something about the function signature being broken across multiple lines is problematic.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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