honeylisp/editor/init.fnl

25 lines
685 B
Fennel

(require :editor.lite)
(local TileView (require :editor.tileedit))
(local core (require :core))
(local command (require :core.command))
(local keymap (require :core.keymap))
(command.add nil {
"honeylisp:edit-tiles" (fn []
(local node (core.root_view:get_active_node))
(node:add_view (TileView))) ; allow hot reload
})
(command.add :editor.tileedit {
"tileedit:save" (fn [] (core.active_view:save) (core.log "Saved tiles"))
"tileedit:next-tile" #(core.active_view:select-rel 1)
"tileedit:previous-tile" #(core.active_view:select-rel -1)
})
(keymap.add {
"ctrl+s" "tileedit:save"
"left" "tileedit:previous-tile"
"right" "tileedit:next-tile"
})