mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
fix(gitbrowse): previous logic always overwrote 'commit' (#1127)
## Description The previous logic didn't check for `fields.commit` when checking whether to switch to `branch` or `repo`, thus `opts.what = "commit"` was always being overwritten. <!-- Describe the big picture of your changes to communicate to the maintainers why we should accept this pull request. --> ## Related Issue(s) None <!-- If this PR fixes any issues, please link to the issue here. - Fixes #<issue_number> --> ## Screenshots <!-- Add screenshots of the changes if applicable. -->
This commit is contained in:
parent
304a60f263
commit
2f3f080ede
1 changed files with 2 additions and 2 deletions
|
@ -186,10 +186,10 @@ function M._open(opts)
|
|||
if not fields.commit and (opts.what == "commit" or opts.what == "permalink") then
|
||||
opts.what = "file"
|
||||
end
|
||||
if not fields.file then
|
||||
if not fields.commit and not fields.file then
|
||||
opts.what = "branch"
|
||||
end
|
||||
if not fields.branch then
|
||||
if not fields.commit and not fields.branch then
|
||||
opts.what = "repo"
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue