Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Sublime Text 3] Arrows break indentation

Open
#133 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
elixir
Domain
tooling

Research direction

Reproduce the issue in Sublime Text 3 with the shown keybinding and the Elixir examples, focusing on reindent when -> ends a line. Inspect the bundle's indentation rules and verify that each cond branch remains at the expected nesting level, then rerun reindent on both short and longer examples.

Written by the indexing model from the issue text.

Description

I have this .exs file

defmodule Bob do
  import String
  def hey(input) do
    cond do
      "" == trim(input) -> 
        "Fine. Be that way!"
      ends_with?(input, "?") -> 
        "Sure."
      input == upcase(input) && input != downcase(input) -> 
        "Whoa, chill out!"
      true ->  
        "Whatever."
    end
  end
end

And in my keybindings I have

{"keys": ["ctrl+alt+/"], "command": "reindent", "args": {"single_line": false}},

But when I reident the file I get

defmodule Bob do
  import String
  def hey(input) do
    cond do
      "" == trim(input) ->
        "Fine. Be that way!"
        ends_with?(input, "?") ->
          "Sure."
          input == upcase(input) && input != downcase(input) ->
            "Whoa, chill out!"
            true ->
              "Whatever."
            end
          end
        end

This happens when the arrow -> is at the end of the line. If the statement is in the same line then the code formatting works fine.

defmodule Bob do
  import String
  def hey(input) do
    cond do
      "" == trim(input) -> "Fine. Be that way!"
      ends_with?(input, "?") -> "Sure."
      input == upcase(input) && input != downcase(input) -> "Whoa, chill out!"
      true ->  "Whatever."
    end
  end
end

And here is an example what happens with a longer file.

defmodule BinarySearch do
  @spec search(tuple, integer) :: {:ok, integer} | :not_found
  def search(numbers, key) do
    high = tuple_size(numbers) - 1
    _search(numbers, key, 0, high)
  end

  defp _search(numbers, key, low, high) do
    midpoint = low + div((high - low), 2)
    cond do
      low > high ->
        :not_found
        elem(numbers, midpoint) == key ->
          {:ok, midpoint}
          elem(numbers, midpoint) > key ->
            _search(numbers, key, low, midpoint - 1)
            elem(numbers, midpoint) < key ->
              _search(numbers, key, midpoint + 1, high)
            end
          end
        end
Dominant language
Python
Stars
262
Forks
65
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from elixir-editors/elixir-tmbundle

All issues in elixir-editors/elixir-tmbundle

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.