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

Bug: nil error on moving to next conflict when first opening the conflict file #91

Open
FredrikMorstad opened this issue Jul 9, 2024 · 1 comment

Comments

@FredrikMorstad
Copy link

FredrikMorstad commented Jul 9, 2024

The problem 🐛

When I run cn my keymap for GitConflictNextConflict before pressing any key I get this error:
Screenshot 2024-07-09 at 00 09 40

Screen.Recording.2024-07-09.at.13.11.09.mov

Here I try running GitConflictNextConflict without pressing any key it and the error gets triggered, if I open it again and press j and the GitConflictNextConflict it works as expected

A quick fix 🩹

Change this to cover match.position being nil

if not match then return end

  if not match or match.positions == nil then return end

This does not handle the main problem that a key must be pressed for the visited_buffers[0].position to not be nil. I can make a PR for the quick fix, but I have to look more into why visited_buffers does not work when no key is pressed

@kovmir
Copy link

kovmir commented Sep 18, 2024

I can confirm this.

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

No branches or pull requests

2 participants