Skip to content

[Bug] crash due to nil target in sync_scroll #550

Open
@dlyongemallo

Description

@dlyongemallo

Description

Occasionally, when exiting neovim with DiffviewOpen, there is an error message: `diffview.nvim/lua/diffview/async.lua:187: The coroutine failed with this message: ... diffview.nvim/lua/diffview/scene/layout.lua:308: attempt to index local 'target' (a nil value)'.

Here's the entire error message:
Screenshot from 2024-12-24 00-50-52

Expected behavior

Neovim exits normally.

Actual behavior

Diffview crashes and neovim displays an error message.

Steps to reproduce

Unfortunately, the issue isn't deterministically reproducible. So the following steps are necessary to reproduce, but possibly insufficient.

  1. start neovim
  2. use DiffviewOpen with some commit
  3. do stuff, then exit

Sometimes, neovim exits normally, and sometimes, the above error appears.

Health check

Output of :checkhealth diffview
diffview: require("diffview.health").check()

Checking plugin dependencies ~
- OK nvim-web-devicons installed.

Checking VCS tools ~
- The plugin requires at least one of the supported VCS tools to be valid.
- OK Git found.
- OK Git is up-to-date. (2.43.0)
- WARNING Configured `hg_cmd` is not executable: 'hg'

Log info

No relevant details from DiffviewLog.

Neovim version

NVIM v0.10.3
Build type: RelWithDebInfo
LuaJIT 2.1.1713484068

Operating system and version

Linux 6.8.0-51-generic x86_64 GNU/Linux

Minimal config

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions