-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to re-order data constructors? #133
Comments
One way that works is to kill and yank only the data constructor, none of the whitespace around it. |
You can select the whole line and kill it or hit But I agree, a way to move things up and down in a list, like M-up/M-down in org-mode, would be nice. |
First of all, I want to say thanks Chris for writing this package. It is really convenient to use and has made my forays into Haskell far more pleasant. On to brass tacks: I think I have a solution to this small problem of reordering data constructors. It has a few hiccups and I don't understand the SHM parsing and overlay mechanism well enough to diagnose the problem to a satisfactory degree. However, since the parser reparses the data constructor of interest if it parses another valid expression, these problems can be resolved by moving the point. I submitted a pull request, so hopefully my previous sentence will become clearer if anyone tests the code. Regards, Emmanuel |
Refer to Open Issue 133 (projectional-haskell#133)
@chrisdone Since I worked on this, do you think the solution that I worked on a couple of years ago is sufficient so that you can close this issue? Regards, Emmanuel |
Refer to Open Issue 133 (projectional-haskell/structured-haskell-mode#133)
Refer to Open Issue 133 (projectional-haskell/structured-haskell-mode#133)
Hey, suppose I've got a data type with multiple constructors and would like to re-order them:
For example, say I want to move
JSIdentifier
to the top. Normally I would useC-k
to kill the line. However it seems the behavior of(shm/kill-line)
is to kill all data constructors to the end of the type. Here that would includeJSIdentifier
,JSLambda
, andJSApplication
.Another way to move the data constructor would be to select it, use kill-region, and yank. (Specifically: place your cursor immediately after the
|
, select, move down one line, kill region, place your cursor after the=
, and then yank.) Following this procedure, killing the line works as expected, but upon yanking, the formatting is not correct:So, how should one actually re-order data constructors?
The text was updated successfully, but these errors were encountered: