Draft: fix: improve discussions panel behaviour#552
Open
jakubbortlik wants to merge 21 commits intoharrisoncramer:developfrom
Open
Draft: fix: improve discussions panel behaviour#552jakubbortlik wants to merge 21 commits intoharrisoncramer:developfrom
jakubbortlik wants to merge 21 commits intoharrisoncramer:developfrom
Conversation
The `vim.api.nvim_get_current_tabpage()` function returns a tab ID, not a tab number, as exemplified by the usage: `vim.cmd.tabclose(vim.api.nvim_tabpage_get_number(M.tabid))`
Introducing more async git calls to prevent blocking UI (cursor and winbar updates) when checking if the local branch is up-to-date with the remote tracking branch. These checks can be async if we just want to notify the user and the following actions are not blocked by the branch being out-of-sync.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is based off my other PR #534, because it takes advantage of the async git system calls. That's why I'm putting it in Draft mode until #534 is merged.
This closes #510 and solves multiple other issues with the discussion panel:
:lua require("gitlab").review()or:lua require("gitlab").toggle_discussions()and the data is loaded after opening the split. This avoids the cursor focus being stolen with a delay or the discussions split being opened in an unexpected tab.root_node.id + line indexhas several benefits: Better cursor restoration, fewer lines of code.:q.nonumber,norelativenumber,breakindent, andshowbreak) do not leak into the reviewer windows when toggling the discussions panel.winfixbufset so that no other buffer can be edited in the window (unless forced by the user).winbarmodule to thediscussionsmodule - this removes some of the spaghetti code that I introduced before.