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
Unexpected pairing of do/end in multiline strings/comments (elixir-mode) #877
Comments
All the other pairs are disabled in comments and strings except I'll have a patch later today, it's quite simple. |
Thanks! Great library by the way :) |
I'm seeing a similar issue in
I've confirmed your fix works as expected in I'm not sure if the issue is here or on the What I'm using at the moment is: (defun rk-sp/in-quoted-content-p (id action context)
(let ((n (treesit-node-at (point))))
(string= (treesit-node-type n) "quoted_content")))
(sp-with-modes '(elixir-ts-mode)
(sp-local-pair "do" "end"
:when '(("SPC" "RET" "<evil-ret>"))
:skip-match 'sp-elixir-skip-def-p
:unless '(rk-sp/in-quoted-content-p))
;; ... more pairs
) Happy to open a new issue to avoid overloading this one. |
Expected behavior
In a multi-line comment (such as those used in
@moduledoc
or@doc
attributes, which are basically just triple-"
quoted multi-line strings), I would expect no automatic pairing.Actual behavior
Smartparens (at least I think it is), performs automatic insertion of
do
andend
after a keyword likeif
when it occurs in the text of the comment/string. This happens anytime I'm typing docs or multi-line strings :(Steps to reproduce the problem
Try defining this module by hand in a buffer with
elixir-mode
active (note: I'm using Spacemacs, there may be something buried in it that is causing this, but if we can figure out what is causing it, I can handle getting a fix upstream :):To be clear about how I'm typing this, I'll write it with any command sequences or (in my case I'm using evil-mode) command-mode keys wrapped in
<>
:defmodule<spc>Foo<esc><o>@moduledoc<spc>"""<ret>If I do<spc>
. When I type that last<spc>
, it insertsend
.Backtraces if necessary (
M-x toggle-debug-on-error
)No errors
Environment & version information
In recent enough
smartparens
you can callM-x sp-describe-system
to generate this report. Please fill manually what we could not detect automatically. Edit the output as you see fit to protect your privacy.smartparens
version: 20180308.1042 (as found in my elpa directory)M-x emacs-version
): 25.3.1If I'm doing something stupid, please let me know, or if this is the fault of another package, let me know that too, and I'll take it from there :)
The text was updated successfully, but these errors were encountered: