abo-abo / lispy

Short and sweet LISP editing
http://oremacs.com/lispy/
1.2k stars 130 forks source link

Misaligned indentation with lispy-tab and racket-mode #621

Open nnoodle opened 2 years ago

nnoodle commented 2 years ago

In racket-mode, pressing i at a subexpression will indent its arguments as if it was at the first column. Pressing i at |(cons makes its arguments appear erratically misaligned.

(define (pair x y)
  (if (and (pair? x) (pair? y))
      |(cons (list (car x)
            (car y))
      (pair (cdr x)
            (cdr y)))
      '()))

Manually removing the horizontal space before |(cons reveals how Lispy was trying to align this expression.

(define (pair x y)
  (if (and (pair? x) (pair? y))
(cons (list (car x)
            (car y))
      (pair (cdr x)
            (cdr y)))
      '()))