Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update deps + fix source-path #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions project.clj
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
(defproject codemirror-parinfer "0.0-SNAPSHOT"
(defproject viebel/codemirror-parinfer "0.0.3"
:description "site for illustrating the value of Parinfer"
:url "http://shaunlebron.github.io/parinfer"

:license {:name "MIT License"
:url "https://github.com/shaunlebron/parinfer/blob/master/LICENSE.md"
:distribution :repo}

:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.122"]
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.9.293"]
[parinfer "0.2.3"]]

:plugins [[lein-cljsbuild "1.1.0"]
[lein-figwheel "0.4.0"]]
:plugins [[lein-cljsbuild "1.1.3"]
[lein-figwheel "0.5.8"]]

:source-paths []
:source-paths ["src"]

:clean-targets ^{:protect false} ["resources/public/js/compiled/out" "target"]

Expand All @@ -31,7 +31,7 @@
:source-paths ["src"]
:compiler {:output-to "resources/public/js/compiled/parinfer.js"
:externs ["resources/public/codemirror/lib/closure-externs.js"]
:main parinfer-codemirror.example
:main parinfer-codemirror.editor
:optimizations :advanced
:pretty-print false}}

Expand Down
6 changes: 6 additions & 0 deletions src/parinfer_codemirror/editor.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,9 @@
;; sync state changes to the editor
(add-watch state :editor-updater on-state-change)
(force-editor-sync!))

(defn ^:export parinferize-and-sync!
"Add parinfer goodness to a codemirror editor"
[cm key- parinfer-mode initial-value]
(parinferize! cm key- parinfer-mode initial-value)
(start-editor-sync!))
10 changes: 5 additions & 5 deletions src/parinfer_codemirror/example.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
cm))))

(defn render-dev! []
+ (create-editor! "code-indent-mode" :indent-mode)
+ (create-editor! "code-paren-mode" :paren-mode {:parinfer-mode :paren-mode})
+ (start-editor-sync!))
+
+(render-dev!)
(create-editor! "code-indent-mode" :indent-mode)
(create-editor! "code-paren-mode" :paren-mode {:parinfer-mode :paren-mode})
(start-editor-sync!))

(render-dev!)