Draft: fix: improve discussions panel behaviour#552
Open
jakubbortlik wants to merge 2 commits into
Open
Conversation
c9ade97 to
4186a8d
Compare
3 tasks
3 tasks
4186a8d to
11efb35
Compare
11efb35 to
7277599
Compare
- Rebases the MR on the server. - Pulls the remote branch after rebasing. - Aborts rebase if it is not necessary, but enables forcing a rebase. - Aborts rebase when there are conflicts. - Adds keymaps for common rebase variants, and for reloading reviewer. - Checks if branch is up-to-date asynchronously.
Main features: - opens discussion tree immediately and loads data asynchronously - improves restoring cursor position after rebuilding trees Minor improvements: - moves view type switching from winbar to discussions - adds protection from invalid line number - replaces deprecated vim.api function
7277599 to
fdc6a0f
Compare
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.