diff --git a/lua/gitlab/actions/merge.lua b/lua/gitlab/actions/merge.lua index f4eb8ff6..455058b2 100644 --- a/lua/gitlab/actions/merge.lua +++ b/lua/gitlab/actions/merge.lua @@ -10,6 +10,7 @@ local M = {} local function create_squash_message_popup() return Popup(popup.create_popup_state({ title = "Squash Commit Message", + filetype = "gitcommit", user_settings = state.settings.popup.squash_message, })) end diff --git a/lua/gitlab/annotations.lua b/lua/gitlab/annotations.lua index 7d66129c..96f9b431 100644 --- a/lua/gitlab/annotations.lua +++ b/lua/gitlab/annotations.lua @@ -427,6 +427,7 @@ ---@class PopupOpts The options for customizing popup windows ---@field title string The string to appear on top of the popup +---@field filetype? string The filetype of the popup (default: markdown) ---@field user_settings? table User-defined popup settings ---@field width? number Override default width ---@field height? number Override default height diff --git a/lua/gitlab/popup.lua b/lua/gitlab/popup.lua index ce986be4..c08e4cf9 100644 --- a/lua/gitlab/popup.lua +++ b/lua/gitlab/popup.lua @@ -6,10 +6,11 @@ local M = {} ---@param opts PopupOpts Options for customizing the popup ---@return table M.create_popup_state = function(opts) + opts = opts or { filetype = "markdown" } local settings = u.merge(require("gitlab.state").settings.popup, opts.user_settings or {}) local view_opts = { buf_options = { - filetype = "markdown", + filetype = opts.filetype, }, relative = "editor", enter = true,