Skip to content

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

Description

@Ambrevar

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:]].

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions