Fix: Only set autocommands for select popups (#315)
Docs: Small improvements to README and docs
Feat: Add branch info to choose_merge_request menu (#318)
Chore: Add heart emoji (#323)
Feat: Add highlight for mentions (#324)
Fix: Do Not Error w/Out Buffer Content (#325)

This is a MINOR release.
This commit is contained in:
Harrison (Harry) Cramer
2024-07-04 18:55:31 -07:00
committed by GitHub
parent 3c9d95d25b
commit dc70c97810
6 changed files with 69 additions and 9 deletions

View File

@@ -2,7 +2,8 @@ if filereadable($VIMRUNTIME . '/syntax/markdown.vim')
source $VIMRUNTIME/syntax/markdown.vim source $VIMRUNTIME/syntax/markdown.vim
endif endif
syntax match Username "@\S*" syntax match Username "\%([]\)\@<= @\S*"
syntax match Mention "\%([] \)\@<!@\S*"
syntax match Date "\v\d+\s+\w+\s+ago" syntax match Date "\v\d+\s+\w+\s+ago"
syntax match ChevronDown "" syntax match ChevronDown ""
syntax match ChevronRight "" syntax match ChevronRight ""
@@ -11,6 +12,7 @@ syntax match Unresolved /\s-\s\?/
syntax match Pencil // syntax match Pencil //
highlight link Username GitlabUsername highlight link Username GitlabUsername
highlight link Mention GitlabMention
highlight link Date GitlabDate highlight link Date GitlabDate
highlight link ChevronDown GitlabChevron highlight link ChevronDown GitlabChevron
highlight link ChevronRight GitlabChevron highlight link ChevronRight GitlabChevron

View File

@@ -3432,6 +3432,54 @@
], ],
"moji": "🤕" "moji": "🤕"
}, },
"heart": {
"unicode": "1F495",
"unicode_alternates": [],
"name": "heart",
"shortname": ":heart:",
"category": "people",
"aliases": [],
"aliases_ascii": [],
"keywords": [
"affection",
"crush",
"face",
"infatuation",
"like",
"love",
"valentines",
"heart",
"lovestruck",
"heart-shaped",
"emotion",
"beautiful"
],
"moji": "❤️ "
},
"hearts": {
"unicode": "1F495",
"unicode_alternates": [],
"name": "hearts",
"shortname": ":hearts:",
"category": "people",
"aliases": [],
"aliases_ascii": [],
"keywords": [
"affection",
"crush",
"face",
"infatuation",
"like",
"love",
"valentines",
"heart",
"lovestruck",
"heart-shaped",
"emotion",
"beautiful"
],
"moji": "❤️ "
},
"heart_eyes": { "heart_eyes": {
"unicode": "1F60D", "unicode": "1F60D",
"unicode_alternates": [], "unicode_alternates": [],

View File

@@ -199,7 +199,7 @@ you call this function with no values the defaults will be used:
reply = "r", -- Reply to comment reply = "r", -- Reply to comment
toggle_node = "t", -- Opens or closes the discussion toggle_node = "t", -- Opens or closes the discussion
add_emoji = "Ea" -- Add an emoji to the note/comment add_emoji = "Ea" -- Add an emoji to the note/comment
add_emoji = "Ed" -- Remove an emoji from a note/comment delete_emoji = "Ed" -- Remove an emoji from a note/comment
toggle_all_discussions = "T", -- Open or close separately both resolved and unresolved discussions toggle_all_discussions = "T", -- Open or close separately both resolved and unresolved discussions
toggle_resolved_discussions = "R", -- Open or close all resolved discussions toggle_resolved_discussions = "R", -- Open or close all resolved discussions
toggle_unresolved_discussions = "U", -- Open or close all unresolved discussions toggle_unresolved_discussions = "U", -- Open or close all unresolved discussions
@@ -283,11 +283,15 @@ you call this function with no values the defaults will be used:
colors = { colors = {
discussion_tree = { discussion_tree = {
username = "Keyword", username = "Keyword",
mention = "WarningMsg",
date = "Comment", date = "Comment",
chevron = "DiffviewNonText", chevron = "DiffviewNonText",
directory = "Directory", directory = "Directory",
directory_icon = "DiffviewFolderSign", directory_icon = "DiffviewFolderSign",
file_name = "Normal", file_name = "Normal",
resolved = "DiagnosticSignOk",
unresolved = "DiagnosticSignWarn",
draft = "DiffviewNonText",
} }
} }
}) })

View File

@@ -5,6 +5,7 @@ local colors = state.settings.colors
local discussion = colors.discussion_tree local discussion = colors.discussion_tree
vim.api.nvim_set_hl(0, "GitlabUsername", u.get_colors_for_group(discussion.username)) vim.api.nvim_set_hl(0, "GitlabUsername", u.get_colors_for_group(discussion.username))
vim.api.nvim_set_hl(0, "GitlabMention", u.get_colors_for_group(discussion.mention))
vim.api.nvim_set_hl(0, "GitlabDate", u.get_colors_for_group(discussion.date)) vim.api.nvim_set_hl(0, "GitlabDate", u.get_colors_for_group(discussion.date))
vim.api.nvim_set_hl(0, "GitlabChevron", u.get_colors_for_group(discussion.chevron)) vim.api.nvim_set_hl(0, "GitlabChevron", u.get_colors_for_group(discussion.chevron))
vim.api.nvim_set_hl(0, "GitlabDirectory", u.get_colors_for_group(discussion.directory)) vim.api.nvim_set_hl(0, "GitlabDirectory", u.get_colors_for_group(discussion.directory))

View File

@@ -74,8 +74,10 @@ M.settings = {
opacity = 1.0, opacity = 1.0,
edit = nil, edit = nil,
comment = nil, comment = nil,
note = nil,
help = nil, help = nil,
pipeline = nil, pipeline = nil,
reply = nil,
squash_message = nil, squash_message = nil,
temp_registers = {}, temp_registers = {},
}, },
@@ -89,9 +91,6 @@ M.settings = {
edit_comment = "e", edit_comment = "e",
delete_comment = "dd", delete_comment = "dd",
refresh_data = "a", refresh_data = "a",
open_in_browser = "b",
copy_node_url = "u",
publish_draft = "P",
reply = "r", reply = "r",
toggle_node = "t", toggle_node = "t",
add_emoji = "Ea", add_emoji = "Ea",
@@ -100,16 +99,19 @@ M.settings = {
toggle_resolved_discussions = "R", toggle_resolved_discussions = "R",
toggle_unresolved_discussions = "U", toggle_unresolved_discussions = "U",
keep_current_open = false, keep_current_open = false,
publish_draft = "P",
toggle_resolved = "p", toggle_resolved = "p",
relative = "editor",
position = "left", position = "left",
open_in_browser = "b",
copy_node_url = "u",
size = "20%", size = "20%",
relative = "editor",
resolved = "", resolved = "",
unresolved = "-", unresolved = "-",
tree_type = "simple", tree_type = "simple",
toggle_tree_type = "i", toggle_tree_type = "i",
toggle_draft_mode = "D",
draft_mode = false, draft_mode = false,
toggle_draft_mode = "D",
}, },
create_mr = { create_mr = {
target = nil, target = nil,
@@ -154,12 +156,12 @@ M.settings = {
severity = vim.diagnostic.severity.INFO, severity = vim.diagnostic.severity.INFO,
virtual_text = false, virtual_text = false,
use_diagnostic_signs = true, use_diagnostic_signs = true,
priority = 100,
icons = { icons = {
comment = "→|", comment = "→|",
range = " |", range = " |",
}, },
skip_old_revision_discussion = false, skip_old_revision_discussion = false,
priority = 100,
}, },
pipeline = { pipeline = {
created = "", created = "",
@@ -177,6 +179,7 @@ M.settings = {
colors = { colors = {
discussion_tree = { discussion_tree = {
username = "Keyword", username = "Keyword",
mention = "WarningMsg",
date = "Comment", date = "Comment",
chevron = "DiffviewNonText", chevron = "DiffviewNonText",
directory = "Directory", directory = "Directory",

View File

@@ -354,6 +354,9 @@ M.split_path = function(path)
end end
M.get_buffer_text = function(bufnr) M.get_buffer_text = function(bufnr)
if not vim.api.nvim_buf_is_valid(bufnr) then
return ""
end
local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false) local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)
local text = table.concat(lines, "\n") local text = table.concat(lines, "\n")
return text return text
@@ -374,7 +377,6 @@ M.string_to_bool = function(str)
elseif str == "false" or str == "False" or str == "FALSE" then elseif str == "false" or str == "False" or str == "FALSE" then
return false return false
end end
M.notify("Not a valid boolean value `" .. str .. "`. Defaulting to `false`", vim.log.levels.WARN)
return false return false
end end