• removes the <esc> keybinding for popups which was causing folks to lose their changes
• deprecates the backup register.
• updates go-gitlab to latest in order to get "drafts" functionality
• fixes issues with labels not deleting correctly
• creates a new data() function to get data from the plugin directly, see :h gitlab.nvim.data
• fixes issues with line values not being computed directly, blocking jumps to/from discussion tree

This is a #MINOR release.
This commit is contained in:
Harrison (Harry) Cramer
2024-04-07 21:45:19 -04:00
committed by GitHub
parent 12c4acb297
commit 36f512cd6d
19 changed files with 299 additions and 177 deletions

View File

@@ -146,7 +146,6 @@ you call this function with no values the defaults will be used:
},
help = "g?", -- Opens a help popup for local keymaps when a relevant view is focused (popup, discussion panel, etc)
popup = { -- The popup for comment creation, editing, and replying
exit = "<Esc>",
perform_action = "<leader>s", -- Once in normal mode, does action (like saving comment or editing description, etc)
perform_linewise_action = "<leader>l", -- Once in normal mode, does the linewise action (see logs for this job, etc)
width = "40%",
@@ -159,7 +158,6 @@ you call this function with no values the defaults will be used:
pipeline = nil,
reply = nil,
squash_message = nil,
backup_register = nil,
},
discussion_tree = { -- The discussion tree that holds all comments
auto_open = true, -- Automatically open when the reviewer is opened
@@ -305,22 +303,6 @@ code block with prefilled code from the visual selection.
Just like the summary, all the different kinds of comments are saved via the
`settings.popup.perform_action` keybinding.
BACKUP REGISTER *gitlab.nvim.backup-register*
Sometimes, the action triggered by `settings.popup.perform_action` can fail.
To prevent losing your carefully crafted note/comment/suggestion you can set
`settings.popup.backup_register` to a writable register (see |registers|) to
which the contents of the popup window will be saved just before the action is
performed. A practical setting is `settings.popup.backup_register = "+"` which
saves to the system clipboard (see |quoteplus|). This lets you easily apply
the action on Gitlab in a browser, if it keeps failing in `gitlab.nvim`.
If you experience such problems, please first read the
|gitlab.nvim.troubleshooting| section. If it does not help, see if there are
any relevant known <https://github.com/harrisoncramer/gitlab.nvim/issues>. If
there are none, please open one and provide any error messages that
`gitlab.nvim` may be showing.
DISCUSSIONS AND NOTES *gitlab.nvim.discussions-and-notes*
Gitlab groups threads of comments together into "discussions."
@@ -751,4 +733,38 @@ Merges the merge request into the target branch
>lua
require("gitlab").merge()
gitlab.data({ opts }, cb) *gitlab.nvim.data*
The data function can be used to integrate `gitlab.nvim` with other plugins and tooling, by fetching
raw data about the current MR, including the summary information (title, description, etc);
reviewers, assignees, pipeline status.
>lua
require("gitlab").data({
{ type = "info", refresh = false },
{ type = "user", refresh = false } }, function (data)
vim.print("The info data is: ", data.info)
vim.print("The user data is: ", data.user)
end)
If the resources have not yet been fetched from Gitlab, this function will
perform API calls for them. Once the data has been fetched, the callback will
execute and passed the data as an argument.
Parameters: ~
• {resources} (table) A list of resource blocks to fetch.
• {resource} (table) A resource to fetch, such as job information, etc.
• {resource.type}: (string) The type of resource, either: "user"
"labels", "project_members", "pipeline," or "revisions"." The types are:
• {user}: Information about the currently authenticated user
• {labels}: The labels available in the current project
• {project_members}: The list of current project members
• {revisions}: Revision information about the MR
• {pipeline}: Information about the current branch's pipeline. Returns
and object with `latest_pipeline` and `jobs` as fields.
• {resource.refresh}: (bool) Whether to re-fetch the data from Gitlab
or use the cached data locally, if available.
• {cb} (function) The callback function that runs after all of the
resources have been fetched. Will be passed a table with the data,
with each resource as a key-value pair, with the key being it's type.
vim:tw=78:ts=8:noet:ft=help:norl: