eraserhd / parinfer-rust

A Rust port of parinfer.
ISC License
546 stars 42 forks source link

(Kakoune) When creating a new line outside of parentheses, the top line and the new line get an extra indent. #73

Closed Anomalocaridid closed 4 years ago

Anomalocaridid commented 4 years ago

I use Kakoune. If I create a new line with "o" or enter, and I am outside of any parentheses, the very top line of the buffer gets indented for some reason. So If I have code like this:

(defparameter *small* 1)

(defparameter *big* 100)

(defun guess-my-number ()
    (ash (+ *small* *big*) -1))

(defun smaller ()
    (setf *big* (1- (guess-my-number)))
    (guess-my-number))

(defun bigger() 
    (setf *small* (1+ (guess-my-number)))
    (guess-my-number))

If I were to create a new line outside any of the pairs of parentheses (lets say, the very bottom, for example), my code would become:

    (defparameter *small* 1)

(defparameter *big* 100)

(defun guess-my-number ()
    (ash (+ *small* *big*) -1))

(defun smaller ()
    (setf *big* (1- (guess-my-number)))
    (guess-my-number))

(defun bigger() 
    (setf *small* (1+ (guess-my-number)))
    (guess-my-number))

And the top line becomes increasingly indented as I edit, assuming that I don't manually remove the indents. In addition, the new line also always has a single indentation.

Anomalocaridid commented 4 years ago

I have determined that it was actually the result of a bug in another plugin I had installed.