lewis6991 / gitsigns.nvim

Git integration for buffers
MIT License
5.13k stars 192 forks source link

OptionSet Autocommand for "fileformat" results in an attempt to yield across C-call boundary #1123

Open ilaitinen opened 1 month ago

ilaitinen commented 1 month ago

Description

Changing the 'fileformat' option results in the following error message:

Error detected while processing OptionSet Autocommands for "fileformat":
Error executing lua callback: ...ns_issue/gitsigns_issue/gitsigns//lua/gitsigns/async.lua:152: attempt to yield across C-call boundary
stack traceback:
        [C]: in function 'yield'
        ...ns_issue/gitsigns_issue/gitsigns//lua/gitsigns/async.lua:152: in function 'scheduler'
        ..._issue/gitsigns_issue/gitsigns//lua/gitsigns/manager.lua:425: in function 'schedule'
        ..._issue/gitsigns_issue/gitsigns//lua/gitsigns/manager.lua:447: in function 'fn'
        ...issue/gitsigns_issue/gitsigns//lua/gitsigns/debounce.lua:68: in function 'update'
        ...s_issue/gitsigns_issue/gitsigns//lua/gitsigns/attach.lua:178: in function <...s_issue/gitsigns_issue/gitsigns//lua/gitsigns/attach.lua:171

Neovim version

NVIM v0.10.1

Operating system and version

MacOS 14.6.1

Expected behavior

No response

Actual behavior

When setting the option for the first time, an error is shown.

Minimal config

for name, url in pairs{
  gitsigns = 'https://github.com/lewis6991/gitsigns.nvim',
} do
local install_path = vim.fn.fnamemodify('gitsigns_issue/'..name, ':p')
if vim.fn.isdirectory(install_path) == 0 then
vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
end
vim.opt.runtimepath:append(install_path)
end

require('gitsigns').setup{
  debug_mode = true, -- You must add this to enable debug messages
}

Steps to reproduce

  1. mkdir gitsigns_issue
  2. cd gitsigns_issue
  3. git init
  4. touch file
  5. git add file
  6. git commit -m 'initial commit'
  7. nvim --clean -u minimal.lua file
  8. :set fileformat=dos

Gitsigns debug messages

No response

Gitsigns cache

No response

lewis6991 commented 1 month ago

Can you confirm your Nvim build has LuaJIT?

ilaitinen commented 1 month ago

NVIM v0.10.1 Build type: Release LuaJIT 2.1.1725453128

bitozoid commented 1 week ago

It also happens to me on Linux. I just need a modeline at the end of the file like:

# vim: ff=unix: