oakmac / sublime-text-parinfer

Parinfer plugin for Sublime Text
ISC License
57 stars 8 forks source link

De-indenting oddity in paren mode #31

Open JoakimLofgren opened 8 years ago

JoakimLofgren commented 8 years ago

Given the file test.clj:

(ns mymodule.test
 (:require [clojure.test :refer :all]
  [mymodule.module :refer :all]))

If I try to de-indent line 2 over and over, in paren mode, it changes line 3 and keeps the line 2 as is. After a few Shift + Tab presses the snippet looks like:

(ns mymodule.test
 (:require [clojure.test :refer :all]
           [mymodule.module :refer :all]))

You can see it go to column 1 but immediately after go back to column 2.

I guess this might be an oddity with Parinfer itself and that it's a weird corner case, I just thought I'd report it anyways.

shaunlebron commented 8 years ago

Good catch, and thanks for posting :+1: This is actually prevented if cursorDx is supplied to Paren Mode for every edit. This has been a hard value to compute for editors, but you can see this bug doesn't exist in the Parinfer site.