This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-02
Channels
- # beginners (29)
- # cider (41)
- # clara (1)
- # cljs-dev (17)
- # cljsrn (1)
- # clojure (158)
- # clojure-dev (2)
- # clojure-dusseldorf (2)
- # clojure-italy (8)
- # clojure-mexico (1)
- # clojure-russia (2)
- # clojure-spec (43)
- # clojure-uk (1)
- # clojurescript (44)
- # community-development (98)
- # cursive (9)
- # data-science (8)
- # datascript (4)
- # datomic (30)
- # emacs (6)
- # fulcro (11)
- # graphql (6)
- # jobs (1)
- # jobs-discuss (27)
- # lein-figwheel (5)
- # luminus (13)
- # lumo (4)
- # off-topic (28)
- # onyx (9)
- # parinfer (12)
- # perun (2)
- # portkey (5)
- # re-frame (48)
- # ring (2)
- # shadow-cljs (52)
- # spacemacs (29)
- # tools-deps (15)
- # unrepl (9)
- # vim (7)
- # yada (3)
So, I managed to figure out what to do from Vim's state, meaning that I can use the same event handler on the several weird Vim events we need to handle, and it Just Works (tm).
Also, I wonder if @shaunlebron has thought about smart mode and tabular arrangement of code... e.g. case
and cond
when the conditions are simple.
Vim has b:changedtick
, which seems to be monotonically increasing every time the buffer changes. So, my only event handler checks if we've seen this tick, if not runs parinfer, updates buffer and cursor pos, etc. Then stores the cursor position for next time.
It runs on all the events we need, and doesn't need to figure out what's happening: CursorMoved, TextChangedI, InsertEnter, etc.