 (def ^:dynamic *keymap*)
 
 (defn- bound-action [ev]
-  (-> ev phalanges/key-set *keymap* (@actions)))
-
-(defaction :flense/text-command :edit identity) ; dummy action to trap ctrl+x keybind
+  (-> ev phalanges/key-set *keymap* actions))
 
 (defn- handle-key [ev]
   (when-let [action (bound-action ev)]
-    (if (= (:name action) :flense/text-command)
+    (if (contains? (:tags (meta action)) :text-command)
       (.. js/document (getElementById "cli") focus)
       (do (.preventDefault ev)
           (async/put! edit-chan action)))))


(defmethod handle-command "exec" [_ & args]
  (if-let [name (first args)]
    (if-let [action (-> name rdr/read-string (@actions))]
      (async/put! edit-chan action)
      (raise! "Invalid action \"" name \"))
    (raise! "Must specify an action to execute")))

(ns flense-nw.app
  (:require [cljs.core.async :as async :refer [<!]]
            [cljs.reader :as rdr]
            [flense.actions :refer [default-actions]]
            [flense.actions.history :as hist]
            [flense.editor :refer [editor-view]]
            [flense.model :as model]
            [flense-nw.cli :refer [cli-view]]
