Release (#440)
* Feat: Enable sorting discussions by original comment (#422) * Feat: Improve popup UX (#426) * Feat: Automatically update MR summary details (#427) * Feat: Show update progress in winbar (#432) * Feat: Abbreviate winbar (#439) * Fix: Note Creation Bug (#441) * Fix: Checking whether comment can be created (#434) * Fix: Syntax in discussion tree (#433) * fix: improve indication of resolved threads and drafts (#442) * Docs: Various minor improvements (#445) --------- Co-authored-by: Jakub F. Bortlík <jakub.bortlik@proton.me>
This commit is contained in:
committed by
GitHub
parent
be027331e1
commit
495e64c8bc
@@ -42,12 +42,21 @@ M.open = function()
|
||||
end
|
||||
|
||||
local diffview_open_command = "DiffviewOpen"
|
||||
local has_clean_tree, err = git.has_clean_tree()
|
||||
if err ~= nil then
|
||||
return
|
||||
end
|
||||
if state.settings.reviewer_settings.diffview.imply_local and has_clean_tree then
|
||||
diffview_open_command = diffview_open_command .. " --imply-local"
|
||||
|
||||
if state.settings.reviewer_settings.diffview.imply_local then
|
||||
local has_clean_tree, err = git.has_clean_tree()
|
||||
if err ~= nil then
|
||||
return
|
||||
end
|
||||
if has_clean_tree then
|
||||
diffview_open_command = diffview_open_command .. " --imply-local"
|
||||
else
|
||||
u.notify(
|
||||
"Your working tree has changes, cannot use 'imply_local' setting for gitlab reviews.\n Stash or commit all changes to use.",
|
||||
vim.log.levels.WARN
|
||||
)
|
||||
state.settings.reviewer_settings.diffview.imply_local = false
|
||||
end
|
||||
end
|
||||
|
||||
vim.api.nvim_command(string.format("%s %s..%s", diffview_open_command, diff_refs.base_sha, diff_refs.head_sha))
|
||||
@@ -55,13 +64,6 @@ M.open = function()
|
||||
M.is_open = true
|
||||
M.tabnr = vim.api.nvim_get_current_tabpage()
|
||||
|
||||
if state.settings.reviewer_settings.diffview.imply_local and not has_clean_tree then
|
||||
u.notify(
|
||||
"There are uncommited changes in the working tree, cannot use 'imply_local' setting for gitlab reviews.\n Stash or commit all changes to use.",
|
||||
vim.log.levels.WARN
|
||||
)
|
||||
end
|
||||
|
||||
if state.settings.discussion_diagnostic ~= nil or state.settings.discussion_sign ~= nil then
|
||||
u.notify(
|
||||
"Diagnostics are now configured as settings.discussion_signs, see :h gitlab.nvim.signs-and-diagnostics",
|
||||
@@ -289,12 +291,16 @@ end
|
||||
M.execute_callback = function(callback)
|
||||
return function()
|
||||
vim.api.nvim_cmd({ cmd = "normal", bang = true, args = { "'[V']" } }, {})
|
||||
vim.api.nvim_cmd(
|
||||
local _, err = pcall(
|
||||
vim.api.nvim_cmd,
|
||||
{ cmd = "lua", args = { ("require'gitlab'.%s()"):format(callback) }, mods = { lockmarks = true } },
|
||||
{}
|
||||
)
|
||||
vim.api.nvim_win_set_cursor(M.old_winnr, M.old_cursor_position)
|
||||
vim.opt.operatorfunc = M.old_opfunc
|
||||
if err ~= "" then
|
||||
u.notify_vim_error(err, vim.log.levels.ERROR)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user