Skip to content

Commit

Permalink
Feat: Make MR title input window configurable (#174)
Browse files Browse the repository at this point in the history
Feat: Make MR title input window configurable
jakubbortlik authored Feb 11, 2024
1 parent affc475 commit 6046669
Showing 4 changed files with 23 additions and 13 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -211,6 +211,10 @@ require("gitlab").setup({
create_mr = {
target = nil, -- Default branch to target when creating an MR
template_file = nil, -- Default MR template in .gitlab/merge_request_templates
title_input = { -- Default settings for MR title input window
width = 40,
border = "rounded",
},
},
colors = {
discussion_tree = {
4 changes: 4 additions & 0 deletions doc/gitlab.nvim.txt
Original file line number Diff line number Diff line change
@@ -246,6 +246,10 @@ you call this function with no values the defaults will be used:
create_mr = {
target = nil, -- Default branch to target when creating an MR
template_file = nil, -- Default MR template in .gitlab/merge_request_templates
title_input = { -- Default settings for MR title input window
width = 40,
border = "rounded",
},
},
colors = {
discussion_tree = {
24 changes: 11 additions & 13 deletions lua/gitlab/actions/create_mr.lua
Original file line number Diff line number Diff line change
@@ -78,18 +78,6 @@ local description_popup_settings = {
},
}

local title_input_options = {
position = "50%",
relative = "editor",
size = 40,
border = {
style = "rounded",
text = {
top = "Title",
},
},
}

---1. If the user has already begun writing an MR, prompt them to
--- continue working on it.
---@param args? Args
@@ -186,7 +174,17 @@ end
---4. Prompts the user for the title of the MR
---@param mr Mr
M.add_title = function(mr)
local input = Input(title_input_options, {
local input = Input({
position = "50%",
relative = "editor",
size = state.settings.create_mr.title_input.width,
border = {
style = state.settings.create_mr.title_input.border,
text = {
top = "Title",
},
},
}, {
prompt = "",
default_value = "",
on_close = function() end,
4 changes: 4 additions & 0 deletions lua/gitlab/state.lua
Original file line number Diff line number Diff line change
@@ -81,6 +81,10 @@ M.settings = {
create_mr = {
target = nil,
template_file = nil,
title_input = {
width = 40,
border = "rounded",
},
},
info = {
enabled = true,

0 comments on commit 6046669

Please sign in to comment.