-
Notifications
You must be signed in to change notification settings - Fork 347
Stepped indentation with haskell-indentation-mode and yasnippets #719
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
Comments
I have noticed that when using |
Haskell-indent-mode is no longer supported I'm afraid.
|
Ah, okay, thanks. So this is for
|
yassnippets have their own github issues page, I guess it is better to report there. |
I'm seeing the same problem as you with Yasnippets really has no control over how the buffer treats indentation as the snippet goes in. All the My feeling at this point is that it's something to do with |
Hi, yasnippet dev here. It looks like there exists a Regardless, I suggest you ask @AndreaCrotti to update the haskell snippets in his repository, or else remove them entirely. |
Hi @npostavs yes well I can definitively update them, but just to be clear only the snippets in haskell mode that would have indentation need that right? |
I tried and this works AndreaCrotti/yasnippet-snippets#107 if that's all we need I'll merge that @npostavs @eigengrau |
Still have this problem on haskell-mode-20160128.621 and yasnippet-20160122.1056. |
@xuzhao9: Can you help us finding the root cause of this? Please do:
Please report back what you found, thanks. |
Hello, I have restarted emacs.
My emacs version is 24.5.1. |
Hi, I am also having this problem:
Any ideas of even a quick workaround? Thanks |
Is this still with the (defun set-yasnippet-fixed-indent ()
(setq-local yas-indent-line 'fixed))
(add-hook 'haskell-mode-hook #'set-yasnippet-fixed-indent) ; EDIT: had the wrong hook name |
This is with other snippets. That doesn't seem to work either I'm afraid. Currently I am just disabling |
Please show a concrete example so that others might have a chance of replicating your problem. |
It's slightly complex, as I'm using Tidal which is built on Haskell and uses the same indentation mode. An example snippet for Tidal would be:
And an example of using this in Tidal would be:
or
In either case, currently using the If you want I can try to see if the problem is exactly the same in plain |
I'm neither a Haskell nor Tidal programmer :) I had the wrong hook variable name in my suggestion above, edited now. After fixing that problem, it seems to work. Started emacs with Evaluate (progn (defun set-yasnippet-fixed-indent ()
(setq-local yas-indent-line 'fixed))
(add-hook 'haskell-mode-hook #'set-yasnippet-fixed-indent))
Hit
|
Wow amazing, can't wait to try this later! Thank you |
That works for the case where the snippet is on a new line, but not when the snippet is in an existing line, which is much more common in Tidal. Any ideas for extending your function to include snippets in existing lines? |
I tried |
That's strange. Are you working with |
Yes, according to |
Looks to me that this issue is more about yasnippets than haskell-indentation. Therefore closing. Thanks for participation! |
When haskell-indent-mode is active, using
ghc-insert-template-or-signature
to expand a class instance stub, or expanding from a yasnippet keyword, produces odd indentation. It looks as if the layout rule is applied after every line.The text was updated successfully, but these errors were encountered: