Follow-up: Require Different Reviewers

This plugin previously only supported the Delta reviewer. Thanks to work
from @mrparalon it now supports Diffview also. This MR adjusts the
requirements to account for this, and the README.

It also addresses a small bug in the original implementation regarding
an async file opening action, and applies formatting to the diffview
file consistent with the rest of the project
This commit is contained in:
Harrison Cramer
2023-09-05 10:22:19 -04:00
parent a2bd0749f0
commit 4792e03416
6 changed files with 83 additions and 67 deletions

View File

@@ -17,11 +17,11 @@ https://github.com/harrisoncramer/gitlab.nvim/assets/32515581/ab5a8597-32fa-4a28
- <a href="https://go.dev/">Go >= v1.19</a>
- <a href="https://www.gnu.org/software/make/manual/make.html">make (for install)</a>
- <a href="https://github.com/dandavison/delta">delta</a>
## Quick Start
1. Install Go and Delta Dependencies
1. Install Go
2. Install reviewer: <a href="https://github.com/dandavison/delta">delta</a> or <a href="https://github.com/sindrets/diffview.nvim">diffview</a>
2. Add configuration (see Installation section)
3. Checkout your feature branch: `git checkout feature-branch`
4. Open Neovim
@@ -42,7 +42,7 @@ return {
},
build = function () require("gitlab.server").build(true) end, -- Builds the Go binary
config = function()
require("gitlab").setup()
require("gitlab").setup() -- Uses delta reviewer by default
end,
}
```
@@ -87,7 +87,7 @@ Here is the default setup function. All of these values are optional, and if you
require("gitlab").setup({
port = 21036, -- The port of the Go server, which runs in the background
log_path = vim.fn.stdpath("cache") .. "/gitlab.nvim.log", -- Log path for the Go server
reviewer = "delta", -- The reviewer type (only delta is currently supported)
reviewer = "delta", -- The reviewer type ("delta" or "diffview")
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)
@@ -108,7 +108,7 @@ require("gitlab").setup({
resolved = '', -- Symbol to show next to resolved discussions
unresolved = '', -- Symbol to show next to unresolved discussions
},
review_pane = { -- Specific settings for different reviewers, only delta currently supported
review_pane = { -- Specific settings for different reviewers
delta = {
added_file = "", -- The symbol to show next to added files
modified_file = "", -- The symbol to show next to modified files