Code Monkey home page Code Monkey logo

Comments (4)

Bogdanp avatar Bogdanp commented on July 29, 2024

The indentation code tends to add a new level on newline-and-indent. Please see the README note about indentation cycling. The gist of it is, every time you get an indentation level you don't expect you should be able to get the one you want simply by hitting tab.

Based on your screenshot, you might also be having issues because your usage of , is somewhat non-standard. The indenter would've worked better had you formatted your lists like this:

div [ id "container ]
  [ pageHeader
  , entryList
  , pageFooter
  ]

Hope that helps! Let me know if any of this is confusing and I'll try to explain it better :)

from elm-mode.

roobie avatar roobie commented on July 29, 2024

I think this is the same issue I am having when I move code between buffers.

Example:

this is the starting point:

dock = foldp updateDocks Dict.empty ships

I want to move these lines from one buffer to the one above (i.e. kill then yank)

port coordinates  : (Int,Int)
port incomingShip : Signal { name:String, capacity:Int }
port outgoingShip : Signal String

I will now paste these three lines of code below the first line:

dock = foldp updateDocks Dict.empty ships

       port coordinates  : (Int,Int)
                           port incomingShip : Signal { name:String, capacity:Int }
                                               port outgoingShip : Signal String

Marking the region and executing indent-region seems to cause the same issue.

from elm-mode.

Bogdanp avatar Bogdanp commented on July 29, 2024

I want to move these lines from one buffer to the one above (i.e. kill then yank)

This is not standard behavior. Your setup must be calling indent-region after inserting the text. If you use spacemacs make sure you add elm-mode to spacemacs-indent-sensitive-modes.

Marking the region and executing indent-region seems to cause the same issue.

The way we handle indentation right now makes indenting a region that contains multiple top-level definitions particularly problematic because, like I mentioned above, we tend to add a new level on each line and we don't distinguish between top-level definitions and everything else. I would say that if you want to use indent region try to limit yourself to one such definition at a time.

from elm-mode.

Bogdanp avatar Bogdanp commented on July 29, 2024

I'm closing this for now. Feel free to re-open it if you have any other questions.

from elm-mode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.