Feat: Make MR title input window configurable (#174)
Feat: Make MR title input window configurable
This commit is contained in:
@@ -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 = {
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -81,6 +81,10 @@ M.settings = {
|
||||
create_mr = {
|
||||
target = nil,
|
||||
template_file = nil,
|
||||
title_input = {
|
||||
width = 40,
|
||||
border = "rounded",
|
||||
},
|
||||
},
|
||||
info = {
|
||||
enabled = true,
|
||||
|
||||
Reference in New Issue
Block a user