diff options
| author | Aotrix <[email protected]> | 2026-04-22 17:58:29 +0200 |
|---|---|---|
| committer | Aotrix <[email protected]> | 2026-04-22 17:58:29 +0200 |
| commit | b21bab39fa105f36b1b6573bc8d302ec32fa6556 (patch) | |
| tree | 366e3e211fb22f4a2b2975d742758b02b592de63 | |
| parent | 2db33ee92e904ebf2c232b12ff66dac73c323556 (diff) | |
floating term with current font size is not a wise idea
| -rw-r--r-- | lua/aotrix/build.lua | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/lua/aotrix/build.lua b/lua/aotrix/build.lua index b5dc3bb..8abf424 100644 --- a/lua/aotrix/build.lua +++ b/lua/aotrix/build.lua @@ -1,32 +1,5 @@ local BUILD_COMMAND = "" ----@return nil -function createFloatingWindow() - local max_height = vim.api.nvim_win_get_height(0) - local max_width = vim.api.nvim_win_get_width(0) - local window_height = math.floor(max_height / 2) - local window_width = math.floor(max_width / 2) - local window_buffer = vim.api.nvim_create_buf(false, true) - vim.api.nvim_open_win(window_buffer, true, { - border = "rounded", - style = "minimal", - relative = "editor", - noautocmd = true, - height = window_height, - width = window_width, - col = math.floor((max_width - window_width) / 2), - row = math.floor((max_height - window_height) / 2) - }) - return window_buffer -end - ----@return nil -function createFloatingTerminal() - createFloatingWindow() - vim.cmd.term() - vim.cmd.startinsert() -end - ---@param command string ---@return nil function executeCommandInTerminal(command) @@ -45,7 +18,8 @@ end function build() if string.len(BUILD_COMMAND) == 0 then setBuildCommand() end if string.len(BUILD_COMMAND) > 0 then - createFloatingTerminal() + vim.cmd.term() + vim.cmd.startinsert() executeCommandInTerminal(BUILD_COMMAND) end end |
