(import-macros {: map!} :hibiscus.vim)
(import-macros {: setup} :macros)

(setup :aerial
  {:close_behavior "global"
   :open_automatic true
   :placement_editor_edge true
   :width 30
   :on_attach (fn [bufnr]
                (map! [n :buffer] :t (fn []
                                       (vim.tbl_map (fn [buf]
                                                      (if (= (vim.api.nvim_buf_get_option buf "filetype") "aerial")
                                                            (vim.tbl_map (fn [win]
                                                                             (vim.api.nvim_set_current_win win))
                                                                         (vim.fn.win_findbuf buf))))
                                                    (vim.api.nvim_list_bufs)))))})
