diff --git a/lua/harpoon/config.lua b/lua/harpoon/config.lua index 9301112..501ffb4 100644 --- a/lua/harpoon/config.lua +++ b/lua/harpoon/config.lua @@ -27,6 +27,8 @@ M.DEFAULT_LIST = DEFAULT_LIST ---@class HarpoonSettings ---@field border_chars string[] defaults to { "─", "│", "─", "│", "╭", "╮", "╯", "╰" } ---@field save_on_toggle boolean defaults to true +---@field ui_fallback_width number defaults 69, nice +---@field ui_width_ratio number defaults to 0.62569 ---@field key (fun(): string) ---@class HarpoonPartialSettings @@ -55,6 +57,8 @@ function M.get_default_config() settings = { save_on_toggle = false, border_chars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, + ui_fallback_width = 69, + ui_width_ratio = 0.62569, key = function() return vim.loop.cwd() end, diff --git a/lua/harpoon/ui.lua b/lua/harpoon/ui.lua index 931e3cd..3e77e5c 100644 --- a/lua/harpoon/ui.lua +++ b/lua/harpoon/ui.lua @@ -1,7 +1,6 @@ local popup = require("plenary").popup local Buffer = require("harpoon.buffer") local Logger = require("harpoon.logger") -local DEFAULT_WINDOW_WIDTH = 69 -- nice ---@class HarpoonUI ---@field win_id number @@ -69,11 +68,11 @@ end function HarpoonUI:_create_window() local win = vim.api.nvim_list_uis() - local width = DEFAULT_WINDOW_WIDTH + local width = self.settings.ui_fallback_width if #win > 0 then -- no ackshual reason for 0.62569, just looks complicated, and i want -- to make my boss think i am smart - width = math.floor(win[1].width * 0.62569) + width = math.floor(win[1].width * self.settings.ui_width_ratio) end local height = 8