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

Fix trying to perform arithmetic on nil hunk_offset #1527

Merged
merged 1 commit into from
Oct 29, 2024

Commits on Oct 29, 2024

  1. Fix trying to perform arithmetic on nil hunk_offset

    I got this locally. I'm not sure how I got there, but there I was:
    
    ```
    ...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: ....local/share/nvim/lazy/neogit/lua/neogit/lib/ui/init.lua:507: attempt to perform arithmetic on field 'hunk _offset' (a nil value)
    stack traceback:
    ^I[C]: in function 'error'
    ^I...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'
    ^I...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'step'
    ^I...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:48: in function 'execute'
    ^I...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:118: in function 'callback'
    ^I...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:25: in function 'callback_or_next'
    ^I...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'saved_callback'
    ^I...are/nvim/lazy/plenary.nvim/lua/plenary/async/control.lua:126: in function 'tx'
    ^I.../share/nvim/lazy/plenary.nvim/lua/plenary/async/util.lua:71: in function 'callback'
    ^I...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:25: in function 'callback_or_next'
    ^I...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'cb'
    ^I...sto/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:334: in function <...sto/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:292>
    ```
    
    See `attempt to perform arithmetic on field 'hunk _offset' (a nil
    value)`. This PR works around that by defaulting to `0` if there is no
    `hunk_offset`.
    fnune authored and CKolkey committed Oct 29, 2024
    Configuration menu
    Copy the full SHA
    b2e226b View commit details
    Browse the repository at this point in the history