Skip to content

comparison between nil and number when viewing diff with sindrets/diffview.nvim #164

@dlyongemallo

Description

@dlyongemallo

Describe the bug

This bug only occurs when hlchunk.nvim is used with sindrets/diffview.nvim. In diffview, open a file with a diff, in particular with a deleted line on one side just before or after a scope (chunk). When moving the cursor past that line, an error occurs: Error executing vim.schedule lua callback: .../hlchunk.nvim/lua/hlchunk/mods/chunk/init.lua:168: attempt to compare nil with number.

To Reproduce
Steps to reproduce the behavior:

  1. Edit a file in a git repo. Delete a line after a scope like {...}.
  2. Open diffview.
  3. Go to the side with the deleted line and cursor around the deleted line.
  4. hlchunk display the above error.

Expected behavior
The cursor moves normally past the deleted line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions