Fork me on GitHub
#parinfer
<
2016-04-09
>
shaunlebron12:04:13

hey @snoe, looks good

shaunlebron12:04:06

looks like your code isn’t inserting extra tab stops though for the 1-space or 2-space indentation levels, right?

shaunlebron12:04:50

from the readme section https://github.com/shaunlebron/parinfer/tree/master/lib#adding-parinfer-to-an-editor, item 5.iii

These returned tab stops only represent open-paren positions, so you need to insert extra tab stops depending on your desired indentation conventions. For example, you can add a tab stop to represent a one-space indentation after every [, a two-space indentation after every (, or even get fancy by reading the text that comes after ( to determine context-specific indentation, as is common in Lisp.

shaunlebron12:04:17

I should probably clarify that with an example

shaunlebron12:04:44

(let [foo 1
|    |
      bar 2])

shaunlebron12:04:37

(let [foo 1
| |  ||
      bar 2])

shaunlebron12:04:45

I supply the tab stops in the first example, and you have to add the extra ones depending on your desired indentation conventions

snoe20:04:01

Ya, so I basically just inc all the stops and then add one at 0. That felt most natural to me but I probably missed somewhere that stopping on the open parens is important.