Skip to content
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

lispy-parens inserts extraneous space when at SLY prompt #550

Open
Ambrevar opened this issue Nov 21, 2020 · 0 comments · May be fixed by #575
Open

lispy-parens inserts extraneous space when at SLY prompt #550

Ambrevar opened this issue Nov 21, 2020 · 0 comments · May be fixed by #575

Comments

@Ambrevar
Copy link

Recipe:

  • M-x sly
  • (

Result:

CL-USER>  ()

instead of the expected

CL-USER> ()

Took me a while to figure this one out, turns out that the issue is in lispy--delimiter-space-unless:

(defun lispy--delimiter-space-unless (preceding-syntax-alist)
  "Like `lispy--space-unless' but use PRECEDING-SYNTAX-ALIST for decision.
PRECEDING-SYNTAX-ALIST should be an alist of `major-mode' to a list of regexps.
When `looking-back' at any of these regexps, whitespace, or a delimiter, do not
insert a space."
  (lispy--space-unless
   (concat "^\\|\\s-\\|" lispy-left
           (lispy--preceding-syntax preceding-syntax-alist "\\|"))))

The problem is that \\s- does not match in the SLY REPL because spaces are not in the syntax table.

Easy fix: change \\s- for [[:space:]].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant