Merge pull request #419 from ktsujister/window-related-settings

feat(ui): accept title_pos option if specified
This commit is contained in:
ThePrimeagen 2023-12-14 20:37:08 -07:00 committed by GitHub
commit 362cdc869f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@ local Extensions = require("harpoon.extensions")
---@class HarpoonToggleOptions
---@field border? any this value is directly passed to nvim_open_win
---@field title_pos? any this value is directly passed to nvim_open_win
---@field ui_fallback_width? number
---@field ui_width_ratio? number
@ -92,6 +93,7 @@ function HarpoonUI:_create_window(toggle_opts)
local win_id = vim.api.nvim_open_win(bufnr, true, {
relative = "editor",
title = "Harpoon",
title_pos = toggle_opts.title_pos or "left",
row = math.floor(((vim.o.lines - height) / 2) - 1),
col = math.floor((vim.o.columns - width) / 2),
width = width,