parinfer / parinfer.js

Let's simplify the way we write Lisp
https://shaunlebron.github.io/parinfer
MIT License
1.75k stars 40 forks source link

redundant indentation #182

Closed shaunlebron closed 1 year ago

shaunlebron commented 6 years ago

problem with https://github.com/oakmac/atom-parinfer/issues/94

When using lisp-paredit in Atom with parinfer, using slurp-forward produces the following example that over-indents children.

input:

(foo ;; <-- slurp forward here (ctrl-alt-.)
  1
  2)

(bar
  3
  4)

actual:

(foo
  1
  2

  (bar
     3
     4))

expected:


(foo
  1
  2

  (bar
    3
    4))

changes array:

[
  {
    "oldText": ")",
    "newText": "",
    "lineNo": 3,
    "x": 3
  },
  {
    "oldText": "",
    "newText": "  ",
    "lineNo": 5,
    "x": 0
  },
  {
    "oldText": "",
    "newText": " ",
    "lineNo": 6,
    "x": 0
  },
  {
    "oldText": "",
    "newText": " ",
    "lineNo": 7,
    "x": 0
  },
  {
    "oldText": "",
    "newText": ")",
    "lineNo": 7,
    "x": 4
  }
]
shaunlebron commented 1 year ago

https://github.com/oakmac/atom-parinfer/issues/94 was fixed