From f0892198729155090e85cdc3c3fd0d4517af8a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bortl=C3=ADk?= Date: Fri, 18 Sep 2026 07:05:15 +0200 Subject: [PATCH] feat: add gitcommit filetype for squash commit popup --- lua/gitlab/actions/merge.lua | 1 + lua/gitlab/annotations.lua | 1 + lua/gitlab/popup.lua | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) 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,