             [org.knotation.editor.update :as update]
 
             [org.knotation.api :as api]
+            [org.knotation.rdf :as rdf]
             [org.knotation.state :as st]
 
             [clojure.string :as string]))

                    :getCompiledLine
                    (fn [ln-num]
                      (when-let [g (.-graph (.-knotation ed))]
                        (first (filter #(= (inc ln-num) (->> % ::st/input ::st/line-number)) g))))}))

    (ln/assign-ix! ed)


(def onLeave on-leave!)

(defn editor!
  [editor-selector & {:keys [mode theme focus? completions]
                      :or {mode "sparql"
                           theme "default"
                           focus? true
                           completions []}}]
  (styles/apply-style!)
  (let [elem (.querySelector js/document editor-selector)
        opts (clj->js {:lineNumbers true :gutters ["CodeMirror-linenumbers" "line-errors"]
