abo-abo / lispy

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

lispy-tab adds extra space before closing curly brace after string #503

Closed ccann closed 5 years ago

ccann commented 5 years ago

Move cursor here: |{:method ... and press i, observe:

{:method :get
 :query-params {:redirect-url "https://www.publisher.com" }}

expected:

{:method :get
 :query-params {:redirect-url "https://www.publisher.com"}}

This doesn't happen if the value of key :redirect-url is not a string. And it doesn't happen when the cursor is here: |{:redirect-url

version: 20190827.1516 cider version: 0.22.0 clojure-mode version: 20190725.654 emacs version: 26.2 (macOS)

abo-abo commented 5 years ago

Thanks, please test.

ccann commented 5 years ago

With version: 20190930.943 I still observe the issue above.

Additionally I have noticed a very similar issue.

{:name ::validate-email
 :get {:parameters {:path {:token :email-validation-token/token}}
       :responses {302 {}}
       :handler (fn [req] (validate-email db req))}}

;; becomes

{:name ::validate-email
 :get {:parameters {:path {:token :email-validation-token/token}}
       :responses {302 {}}
       :handler (fn [req] (validate-email db req)) }}
                                                 ^^^^

when keying i with the cursor at the outermost bracket |{:name ... but this does not happen when the cursor is positioned at |{:parameters ...

I can open a different issue if that is preferable.

abo-abo commented 5 years ago

The new issue you describe is fixed by the latest code. You just have to wait 4 hours for MELPA to update :) Or clone the latest master from Git.

ccann commented 5 years ago

Ah, wasn't aware of that delay. Both issues appear to be resolved. Thanks @abo-abo :-)