diff --git a/flake.lock b/flake.lock index 4f7c8ae..56cdccd 100644 --- a/flake.lock +++ b/flake.lock @@ -5992,11 +5992,11 @@ "toggleterm-nvim": { "flake": false, "locked": { - "lastModified": 1731162901, - "narHash": "sha256-g1FwgCc3a8Fak0Nb0gQQ+SI44uyAGaH1tIk1qpaAPEY=", + "lastModified": 1735582456, + "narHash": "sha256-4Y1TXxnrMLqwFlmbj39JTlcUToP80kWU+FpPUrYdz8s=", "owner": "akinsho", "repo": "toggleterm.nvim", - "rev": "87b2d6a3cab8e2bd9a0255427074285f0365398d", + "rev": "e76134e682c1a866e3dfcdaeb691eb7b01068668", "type": "github" }, "original": { diff --git a/fnl/toggleterm.fnl b/fnl/toggleterm.fnl index 9725d42..c53c0fd 100644 --- a/fnl/toggleterm.fnl +++ b/fnl/toggleterm.fnl @@ -1,8 +1,17 @@ (let [M (require :toggleterm) size (fn [term] (if (= term.direction :horizontal) (* vim.o.lines 0.35) - (* vim.o.columns 0.5)))] + (* vim.o.columns 0.5))) + float_opts {:border :single + :width (fn [] (math.min vim.o.columns 150)) + :height (fn [] (math.floor (* vim.o.lines 0.8))) + ; :row + ; :col + ; :winblend 3 + ; zindex + :title_pos :center}] (M.setup {: size + : float_opts :shade_terminals false :auto_scroll false :start_in_insert true diff --git a/fnl/toolwindow.fnl b/fnl/toolwindow.fnl index a1c7a56..5cf594e 100644 --- a/fnl/toolwindow.fnl +++ b/fnl/toolwindow.fnl @@ -4,7 +4,7 @@ term_open (fn [_plugin args] (doto (let [val (. term_table args.idx)] (if (= val nil) - (let [term (Terminal:new {:direction :horizontal})] + (let [term (Terminal:new {:direction :float})] (tset term_table args.idx term) term) (. term_table args.idx))) diff --git a/lua/autogen/toggleterm.lua b/lua/autogen/toggleterm.lua index a441283..fbe73ba 100644 --- a/lua/autogen/toggleterm.lua +++ b/lua/autogen/toggleterm.lua @@ -9,4 +9,12 @@ local function _1_(term) end end size = _1_ -return M.setup({size = size, start_in_insert = true, winbar = {enabled = false}, auto_scroll = false, shade_terminals = false}) +local float_opts +local function _3_() + return math.min(vim.o.columns, 150) +end +local function _4_() + return math.floor((vim.o.lines * 0.8)) +end +float_opts = {border = "single", width = _3_, height = _4_, title_pos = "center"} +return M.setup({size = size, float_opts = float_opts, start_in_insert = true, winbar = {enabled = false}, auto_scroll = false, shade_terminals = false}) diff --git a/lua/autogen/toolwindow.lua b/lua/autogen/toolwindow.lua index 55912f2..2b45a43 100644 --- a/lua/autogen/toolwindow.lua +++ b/lua/autogen/toolwindow.lua @@ -8,7 +8,7 @@ local function _1_(_plugin, args) do local val = term_table[args.idx] if (val == nil) then - local term = Terminal:new({direction = "horizontal"}) + local term = Terminal:new({direction = "float"}) term_table[args.idx] = term tmp_9_auto = term else