Uploaded image for project: 'Erlang/OTP'
  1. Erlang/OTP
  2. ERL-526

Binary in a multiline list comprehension nests wrongly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Help Wanted
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 20.1
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
      None

      Description

      Example code before (erlang-indent-current-buffer):

      -module(passthrough).
      -export([a/1]).
      a(L) ->
          [<<>>
           || _ <- L
          ].
      

      Same code after (erlang-indent-current-buffer):

      -module(passthrough).
      -export([a/1]).
      a(L) ->
          [<<>>
               || _ <- L
          ].
      

      Note Emacs indents the || properly if the lhs of || is anything but a binary literal.

      Minified test cases: https://github.com/fenollp/erlang-formatter/pull/21/files
      Formatting code used: https://github.com/fenollp/erlang-formatter/blob/343a059362950e5b59b5c02ce30ee2e6ed7fe2c2/fmt.el

        Attachments

          Activity

            People

            Assignee:
            otp_team_ps Team PS
            Reporter:
            fenollp fenollp
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: