Release 1/24/26 (#519)
* Fix: Jumping to renamed files (#484) * fix: prevent "cursor position outside buffer" error * fix: swap file_name and old_file_name in reviewer data `old_file_name` is not set to the empty string for un-renamed files anymore, because then we can remove the empty-line check in `comment_helpers.go` which was used to replace the empty string with the current file name anyway. * fix: add old_file_name to discussion root node data * fix: also consider old_file_name when jumping to the reviewer This fixes jumping to renamed files, however, may not work for comments that were created on renamed files with the previous version of `gitlab.nvim` as that version assigned the `file_name` and `old_file_name` incorrectly. * refactor: don't shadow variable * fix: check file_name or old_file_name based on which SHA comment belongs to * Fix: Store reviewer data before creating comment popup (#476) * Fix: Make publishing drafts more robust (#483) * Fix: Swap file_name and old_file_name in reviewer data (#485) * Feat: Enable toggling date format between relative and absolute (#491) * Fix: Add opts to help popup (#492) * Fix: Force start_line for jumping to diagnostic to be inside buffer (#494) * fix: redefine colors after reloading colorscheme (#500) * Fix: Use path instead of oldpath as fallback for unrenamed files (#496) * Fix: Use file_name when old_file_name is not set (#495) * fix(ci): fix lua tests (#501) * Proxy Support (#499) * feat(ci): Cancel obsolete after a new commit is pushed in an open PR (#503) * fix: start and clean up winbar timer properly (#513) This is a PATCH. * fix: put attach_file markdown on new line (#512) This is a PATCH PR. * docs: fix incorrect value for 'relative' option to Split (#511) This is a PATCH. * docs: add default keybinding maps available in the help (#506) This is a PATCH change. * feat: enable setting discussion tree options (#509) * docs: add description of `refresh_data` function * fix: only set gitlab filetype in one place * feat: set some useful window options for the discussion tree split This is a PATCH PR. --------- Co-authored-by: Jakub F. Bortlík <jakub.bortlik@proton.me> Co-authored-by: Jonathan Duck <Duckbrain30@gmail.com> Co-authored-by: Kitsios Konstantinos <kitsios.konst@gmail.com> Co-authored-by: Mohammad Akbari <makbari@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
e29909cd10
commit
e4eabaf71d
@@ -262,7 +262,7 @@ you call this function with no values the defaults will be used:
|
||||
keep_current_open = false, -- If true, current discussion stays open even if it should otherwise be closed when toggling
|
||||
position = "bottom", -- "top", "right", "bottom" or "left"
|
||||
size = "20%", -- Size of split
|
||||
relative = "editor", -- Position of tree split relative to "editor" or "window"
|
||||
relative = "editor", -- Position of tree split relative to "editor" or "win" (window)
|
||||
resolved = '✓', -- Symbol to show next to resolved discussions
|
||||
unresolved = '-', -- Symbol to show next to unresolved discussions
|
||||
unlinked = "", -- Symbol to show next to unliked comments (i.e., not threads)
|
||||
@@ -270,6 +270,12 @@ you call this function with no values the defaults will be used:
|
||||
tree_type = "simple", -- Type of discussion tree - "simple" means just list of discussions, "by_file_name" means file tree with discussions under file
|
||||
draft_mode = false, -- Whether comments are posted as drafts as part of a review
|
||||
relative_date = true, -- Whether to show relative time like "5 days ago" or absolute time like "03/01/2025 at 01:43"
|
||||
winopts = { -- Window-local options for the discussion tree split
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
breakindent = true, -- Every wrapped line will continue visually indented
|
||||
showbreak = "+ ", -- String to put at the start of lines that have been wrapped
|
||||
}
|
||||
winbar = nil, -- Custom function to return winbar title, should return a string. Provided with WinbarTable (defined in annotations.lua)
|
||||
-- If using lualine, please add "gitlab" to disabled file types, otherwise you will not see the winbar.
|
||||
},
|
||||
@@ -1078,4 +1084,25 @@ execute and passed the data as an argument.
|
||||
with each resource as a key-value pair, with the key being it's
|
||||
type.
|
||||
|
||||
*gitlab.nvim.data*
|
||||
gitlab.refresh_data() ~
|
||||
|
||||
Fetches discussion tree data from Gitlab and refreshes the tree views. It can
|
||||
be used in an autocommand to refresh the data every time you enter the
|
||||
discussion tree. This exmaple shows how to easily limit the refresh rate to at
|
||||
least 10 seconds:
|
||||
>lua
|
||||
local last_updated = os.time()
|
||||
local gitlab = vim.api.nvim_create_augroup("Gitlab", {})
|
||||
vim.api.nvim_create_autocmd("BufEnter", {
|
||||
group = gitlab,
|
||||
callback = function()
|
||||
if vim.bo.filetype == "gitlab" and os.time() - last_updated > 10 then
|
||||
require("gitlab").refresh_data()
|
||||
last_updated = os.time()
|
||||
end
|
||||
end
|
||||
})
|
||||
<
|
||||
|
||||
vim:tw=78:ts=4:sw=4:expandtab:ft=help:norl:
|
||||
|
||||
Reference in New Issue
Block a user