From 7dfd6d24e7051f63f971a10c339928f87b0a4c1b Mon Sep 17 00:00:00 2001 From: "Harrison (Harry) Cramer" <32515581+harrisoncramer@users.noreply.github.com> Date: Mon, 14 Aug 2023 07:43:17 -0400 Subject: [PATCH] Update README.md --- README.md | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/README.md b/README.md index a6345a5..10c2253 100644 --- a/README.md +++ b/README.md @@ -171,31 +171,6 @@ vim.keymap.set("n", "glc", gitlab.create_comment) vim.keymap.set("n", "gld", gitlab.list_discussions) ``` -## Diff Views - -This plugin does not provide you with a diff view out of the box for viewing changes. That is already handled by other plugins. I highly recommend using Diffview to see which files have changed in an MR. This is the function that I'm using to accomplish this: - -```lua --- Review changes against develop (will break if no develop branch present) -vim.keymap.set("n", "gR", function() - local isDiff = vim.fn.getwinvar(nil, "&diff") - local bufName = vim.api.nvim_buf_get_name(0) - if isDiff ~= 0 or u.string_starts(bufName, "diff") then - vim.cmd.tabclose() - vim.cmd.tabprev() - else - vim.cmd.DiffviewOpen("main") - end -end) -``` - -Which looks like this in my editor: - -Screenshot 2023-04-21 at 6 37 39 PM - -This is useful if you plan to leave comments on the diff, because this plugin currently only supports leaving comments on lines that have been added or modified. I'm currenly working on adding functionality to allow users to leave comments on any lines, including those that have been deleted or untouched. - - ## Troubleshooting This plugin uses a Golang server to reach out to Gitlab. The Golang server runs outside of Neovim, and can be interacted with directly in order to troubleshoot. The server will start up when you open Neovim with a MR branch. You can curl it directly: