This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-27
Channels
- # aleph (2)
- # beginners (19)
- # boot (15)
- # cider (1)
- # cljsrn (1)
- # clojure (68)
- # clojure-austin (12)
- # clojure-dev (2)
- # clojure-france (6)
- # clojure-italy (46)
- # clojure-russia (45)
- # clojure-spec (55)
- # clojure-uk (41)
- # clojurescript (117)
- # component (15)
- # cursive (54)
- # datomic (24)
- # events (2)
- # funcool (1)
- # instaparse (4)
- # klipse (30)
- # lein-figwheel (3)
- # leiningen (4)
- # luminus (4)
- # om (10)
- # onyx (13)
- # parinfer (36)
- # proton (1)
- # reagent (1)
- # ring (2)
- # ring-swagger (1)
- # rum (19)
- # test-check (6)
- # testing (9)
- # untangled (1)
AFAICT, parinfer-jvm has not been uploaded to clojars yet. Is it nascent? Should I use cross-parinfer?
@eraserhd I think it’s pretty stable. Cursive’s solution is based on it (although doesn’t use the exact code) and I believe @sekao uses it in nightcode.
I haven’t deployed it to clojars partly out of laziness and also because you’ll probably double the number of users if you use it 🙂
Hi, @snoe . Will this be considered about?
https://github.com/clojure-vim/nvim-parinfer.js/issues/22
each >>
will change the struct of sexp, but we may want the correct indentation instead of the minimal indentation after >>
operation.
If we have:
(str "hello")
"world"
after >>
on line 2, we probably want:
(str "hello"
"world")
instead of
(str "hello"
"world")
@doglooksgood I've been thinking about this, I feel the answer is to use a formatting plugin like clojure-static or clj-fmt after indenting and add do a =-
(for instance) after indenting . However, I tried doing this, and it's difficult to do because of the way nvim-parinfer.js is mapping >>
(you can't map a map).
when doing (`>>` or >
with multiple lines), saving the begin line number
and end line number
. after >>
, use =
to format this lines. is it possible?
i'm not familiar with vim script. or you means the difficult stuff is how to map keys?
I don't think so, I believe with parinfer you pretty much always want to indent at the top level. (again, I haven't touched it for awhile)
I didn't know that vim-sexp has =-
, with this shortcut i can quick indent top level manaully. it's still convenient.
wrt nvim-parinfer.js
, I'd like to figure out how to make it stop touching files that I open.
I guess the place to start is looking at https://github.com/clojure-vim/nvim-parinfer.js/blob/master/plugin/parinfer.vim#L22 and figure out if lines
differ from :echo getline(1,'$')
Just got familiar with the plugin code. Let me see if I can make a small test case first, though.
Hrmm, it kept happening when pairing today, but the only file it's happened on right now was literrally wrongly indented.
https://github.com/clojure-vim/nvim-parinfer.js/blob/master/src/nvim_parinfer/main.cljs#L42 I wonder if it's line endings, since vim doesn't give me those
yup that did it. Lots of stuff like this:
diff --git a/src/twou/centralpark/devcards.cljs b/src/twou/centralpark/devcards.cljs
index 0d81853..de0ec23 100644
--- a/src/twou/centralpark/devcards.cljs
+++ b/src/twou/centralpark/devcards.cljs
@@ -1,8 +1,8 @@
(ns twou.centralpark.devcards
- (:require
- [twou.centralpark.devcards.domain]
- [twou.centralpark.devcards.workflow]
- [devcards.core :as dc :include-macros true]))
+ (:require
+ [twou.centralpark.devcards.domain]
+ [twou.centralpark.devcards.workflow]
+ [devcards.core :as dc :include-macros true]))
There's a lot of changes, but it looks like the changes are all either a) legitimate fixes, or b) dedenting the second line of the file (inside the ns directive) by one.
I wonder if you pass the text through https://github.com/shaunlebron/parinfer/blob/master/lib/parinfer.js#L883 you still get the dedent
Here's the simplest example: https://gist.github.com/eraserhd/4d35251bb1f64d8a05fd983363fe765d
looks like i'm passing a negative cusrorDx
> parinfer.parenMode('(ab\n :q)', {cursorX: 0, cursorDx: 0, cursorLine: 0})
{ text: '(ab\n :q)',
cursorX: 0,
success: true,
changedLines: [],
tabStops: [] }
> parinfer.parenMode('(ab\n :q)', {cursorX: 0, cursorDx: -6, cursorLine: 0})
{ text: '(ab\n :q)',
cursorX: 0,
success: true,
changedLines: [ { lineNo: 1, line: ' :q)' } ],
tabStops: [] }