Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow disabling auto review thread opening #598

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

GuillaumeLagrange
Copy link
Collaborator

Describe what this PR does / why we need it

Add a config option to disable the auto thread opening on cursor move during review

Due to how diff works in nvim, I found it very hard to focus whenever there was more than one or two comments on a file

Does this pull request fix one issue?

Fixes #536

Describe how you did it

  • Add the config option
  • Create a command to call show review thread so that users can bind it
  • When the config option is set,
    • do not create the cursor move autocmd that calls show review thread
    • create an local buffer keybind to close the comment buffer on q since it no longer auto closes when going back to diff

Describe how to verify it

Octo config

  opts = {
    reviews = {
      auto_show_threads = false,
    },
  },

Open a pr review

  • Go on a thread, call <CMD>Octo review thread<CR>
    or
  • Create a comment using <CMD>Octo comment add<CR>

See buffer open, and press q to close it

@pwntester
Copy link
Owner

Thanks @GuillaumeLagrange looks good to me and actually may use it myself 😄

@pwntester pwntester merged commit aad50e0 into pwntester:master Sep 13, 2024
2 checks passed
@GuillaumeLagrange
Copy link
Collaborator Author

I have noticed a small regression that I believe this causes: if you open a comment from the left diff window (comment buffer opens on the right window), the diffthis is not properly applied to the right window on closing the comment buffer.

I'll open a PR with the fix

@GuillaumeLagrange GuillaumeLagrange deleted the popup-comment-thread branch September 13, 2024 11:03
@GuillaumeLagrange
Copy link
Collaborator Author

I can't reproduce, it must have been a half baked local feature causing it, sorry for the useless ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Less jumping around due to folds when opening comment threads during review
2 participants