weixin_39553352 2020-11-29 12:07
浏览 0

Unmatched close-parens

thanks to for bringing this up.

Currently, unmatched close-parens are removed indiscriminately. This is a problem for the following case

 clj
(foo [|bar) baz

because Indent Mode will turn it into:

 clj
(foo [|bar baz])

The obvious solution is to match the ) with the ( further back, then to close all open-parens between them, so that we have this:

 clj
(foo [|bar]) baz

But this new behavior would imply that typing an unmatched ) below

 clj
(foo [bar| baz])

would result in:

 clj
(foo [bar])| baz

I will look at how this affects Indent Mode.

该提问来源于开源项目:shaunlebron/parinfer

  • 写回答

8条回答 默认 最新

  • weixin_39553352 2020-11-29 12:07
    关注

    fixing this would break barf feature seen here:

    http://shaunlebron.github.io/parinfer/#inserting-parens

    评论

报告相同问题?