Winbar Support + Notes and Discussions; Help Popup + Auto-Open (#133)

- Adds support for toggling between discussions and notes views
- Deprecates the split view shared with both discussions and notes at the same time
- Adds winbar to discussion split, with metadata about resolved and unresolved discussions
- Adds help popups with information about keybindings for all views
- Modifies highlights in discussion tree and default symbol for unresolved discussions

This is a MINOR version bump as the default behavior of the discussion tree is changed slightly. Existing configurations should still function.
This commit is contained in:
Harrison (Harry) Cramer
2023-12-13 17:46:34 -05:00
committed by GitHub
parent d5038d63ca
commit d5510f9d9a
13 changed files with 588 additions and 428 deletions

View File

@@ -262,17 +262,6 @@ M.split_path = function(path)
return path_parts
end
M.P = function(...)
local objects = {}
for i = 1, select("#", ...) do
local v = select(i, ...)
table.insert(objects, vim.inspect(v))
end
print(table.concat(objects, "\n"))
return ...
end
M.get_buffer_text = function(bufnr)
local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)
local text = table.concat(lines, "\n")
@@ -347,10 +336,10 @@ end
---Get the popup view_opts
---@param title string The string to appear on top of the popup
---@param settings table User defined popup settings
---@param width string Override default width
---@param height string Override default height
---@param width number? Override default width
---@param height number? Override default height
---@return table
M.create_popup_state = function(title, settings, width, height)
M.create_popup_state = function(title, settings, width, height, zindex)
local default_settings = require("gitlab.state").settings.popup
local user_settings = settings or {}
local view_opts = {
@@ -360,6 +349,7 @@ M.create_popup_state = function(title, settings, width, height)
relative = "editor",
enter = true,
focusable = true,
zindex = zindex or 50,
border = {
style = user_settings.border or default_settings.border,
text = {
@@ -373,6 +363,7 @@ M.create_popup_state = function(title, settings, width, height)
},
opacity = user_settings.opacity or default_settings.opacity,
}
return view_opts
end
@@ -627,4 +618,9 @@ M.get_icon = function(filename)
end
end
M.basename = function(str)
local name = string.gsub(str, "(.*/)(.*)", "%2")
return name
end
return M