smartparens
smartparens copied to clipboard
Extra trailing brace after haskell comment
Expected behavior
Typing {- in haskell-mode results in {-|-} in the buffer, where | is the point
Actual behavior
Typing {- in haskell-mode results in {-|-}} in the buffer.
Steps to reproduce the problem
- Open a haskell-mode buffer
- Enable smartparens
- Type
{and then-
Environment & version information
smartparensversion: 9738360eb2afb58b4c21815f9d5c793b8125f540 (latest master)- Active
major-mode:haskell-mode - Smartparens strict mode: nil
- Emacs version (
M-x emacs-version): GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10) of 2019-08-29 - Starterkit/Distribution: Doom
- OS: gnu/linux
I have E 26.1 and can't reproduce this problem. My haskell-mode version is 1bee161d3cea973d4ee3ff7acf980bf2cdeb83e2 from Thu Sep 26 17:51:08 2019 +1200
I am seeing this too.
Emacs: 27.2 smartparens: 63695c64233d215a92bf08e762f643cdb595bdd9 haskell-mode: 1baa12abfa2c81128e5b13d1351f2978a4a54b4f
I'm also having this problem
I still can't repro on latest haskell-mode 333205066754348b3dd47c5ce834757dd1bbdf48

Hey @Fuco1! Thanks for your fast reply. I don't know about the other two comments, but looks like my problem is caused by doom-emacs' default config, so I fixed it on my side.
so I fixed it on my side.
Any chance you could be talked into sharing how?
@peterhoeg sure!
You can either disable doom-emacs smartparens configuration, or add something like this to your config.el:
(after! (smartparens haskell-mode)
(sp-with-modes '(haskell-mode haskell-interactive-mode)
(sp-local-pair "{-" "-}" :actions :rem)
(sp-local-pair "{-#" "#-}" :actions :rem)
(sp-local-pair "{-@" "@-}" :actions :rem)
(sp-local-pair "{-" "-")
(sp-local-pair "{-#" "#-")
(sp-local-pair "{-@" "@-")))
I've also created a PR for this in the doom-emacs repo, btw: https://github.com/hlissner/doom-emacs/pull/5450
I have an alternative fix, disabling dooms global "{" "}" pair
(after! (smartparens haskell-mode)
(sp-with-modes '(haskell-mode haskell-interactive-mode)
(sp-local-pair "{" "}" :actions :rem)
))
This is unfortunate, because { } should be pairs in haskell. e.g. \case {True -> False; False -> True}.
Perhaps you could demonstrate how to configure smartparens with pairs that overlap this way?
I tried now on Emacs 28.2 and haskell mode 333205066754348b3dd47c5ce834757dd1bbdf48 and all the pairs work correctly with the default smartparens haskell config, including the { pair.
If there are some more issues please open new issues with the template filled in, particularly the part about emacs config / distribution.