justinbarclay / parinfer-rust-mode

Simplifying how you write Lisp
https://shaunlebron.github.io/parinfer/
GNU General Public License v3.0
227 stars 16 forks source link

wrong indentation on new line with sly #69

Open monroth opened 1 year ago

monroth commented 1 year ago

I'm using parinfer-rust for common lisp with sly. I define function

(defun calculate-brick (size color steps)
  (let* ((png (make-instance 'zpng:png
                             :color-type :truecolor-alpha
                             :width size
                             :height size))
         (image (zpng:data-array png)))
    (dotimes (y size (zpng:write-png png "example.png"))
      (dotimes (x size)
        (dotimes (i 3)
          (setf (aref image y x i) (elt (gethash color *color-table*) i))) 
        (setf (aref image y x 3) 255)))))

When I turn on sly only, if i insert new line before second to last setf (cursor is right before (setf), it indents setf correctly --- with same amount of spaces so it goes from this

        (dotimes (i 3)
          (setf (aref image y x i) (elt (gethash color *color-table*) i))) 
        (setf (aref image y x 3) 255)))))

to this

        (dotimes (i 3)

          (setf (aref image y x i) (elt (gethash color *color-table*) i))) 
        (setf (aref image y x 3) 255)))))

However. when i turn on parinfer-rust-mode and do same (cursor on ( before first setf, press RET), it indents new line very poorly

        (dotimes (i 3))))

    (setf (aref image y x i) (elt (gethash color *color-table*) i) 
        (setf (aref image y x 3) 255))))

and thus change sexp structure.

I have some other packages installed, but i can reproduce this after removing my .emacs file and .emacs.d directory and installing only parinfer-rust and sly.