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

nvim 100% CPU And Frozen When modified.enabled = true #1878

Closed
alex-courtis opened this issue Jan 2, 2023 · 4 comments · Fixed by #1879
Closed

nvim 100% CPU And Frozen When modified.enabled = true #1878

alex-courtis opened this issue Jan 2, 2023 · 4 comments · Fixed by #1879
Labels
bug Something isn't working

Comments

@alex-courtis
Copy link
Member

Description

nvim will freeze and process will use 100% CPU when first editing a no name new buffer.

Neovim version

NVIM v0.8.2
Build type: Release
LuaJIT 2.1.0-beta3

Operating system and version

Linux 6.1.1-arch1-1

nvim-tree version

since dcc344c

Minimal config

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvt-min/site]]
local package_root = "/tmp/nvt-min/site/pack"
local install_path = package_root .. "/packer/start/packer.nvim"
local function load_plugins()
  require("packer").startup {
    {
      "wbthomason/packer.nvim",
      "nvim-tree/nvim-tree.lua",
      "nvim-tree/nvim-web-devicons",
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. "/plugin/packer_compiled.lua",
      display = { non_interactive = true },
    },
  }
end
if vim.fn.isdirectory(install_path) == 0 then
  print "Installing nvim-tree and dependencies."
  vim.fn.system { "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path }
end
load_plugins()
require("packer").sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua setup()]]
vim.opt.termguicolors = true
vim.opt.cursorline = true

-- MODIFY NVIM-TREE SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
_G.setup = function()
  require("nvim-tree").setup {
	  modified = {
		  enable = true,
	  },
	  log = {
		  enable = true,
		  truncate = true,
		  types = {
			  all = true,
		  },
	  },
  }
end

Steps to reproduce

nvim -nu /tmp/nvt-min.lua

:NvimTreeOpen
<C-w>w
isomething

Expected behavior

No response

Actual behavior

No response

@alex-courtis alex-courtis added the bug Something isn't working label Jan 2, 2023
@alex-courtis
Copy link
Member Author

Workaround:

	  modified = {
		  enable = false,

@alex-courtis
Copy link
Member Author

Nothing in logs after opening tree.

@alex-courtis
Copy link
Member Author

very odd:

#0  0x00007f6966a58a63 in getcwd () from /usr/lib/libc.so.6
[Current thread is 1 (Thread 0x7f696695c740 (LWP 10112))]
(gdb) bt
#0  0x00007f6966a58a63 in getcwd () from /usr/lib/libc.so.6
#1  0x00007f6966d5bbec in uv_cwd () from /usr/lib/libuv.so.1
#2  0x000055ae6f9956cf in os_dirname ()
#3  0x000055ae6f85f051 in ?? ()
#4  0x000055ae6f850367 in call_internal_func ()
#5  0x000055ae6f87cbee in call_func ()
#6  0x000055ae6f90df4b in nlua_call ()
#7  0x00007f6966b71ef6 in ?? () from /usr/lib/libluajit-5.1.so.2
#8  0x00007f6966b848d3 in lua_pcall () from /usr/lib/libluajit-5.1.so.2
#9  0x000055ae6f90634d in ?? ()
#10 0x000055ae6f90b850 in ?? ()
#11 0x000055ae6fa2d86b in state_handle_k_event ()
#12 0x000055ae6f837726 in ?? ()
#13 0x000055ae6fa2d68e in state_enter ()
#14 0x000055ae6f830db2 in edit ()
#15 0x000055ae6f969ec8 in ?? ()
#16 0x000055ae6f960dc8 in ?? ()
#17 0x000055ae6fa2d6d7 in state_enter ()
#18 0x000055ae6f95c949 in normal_enter ()
#19 0x000055ae6f79ed8b in main ()

@alex-courtis
Copy link
Member Author

@chomosuke I'd be most grateful if you could look into this one.

alex-courtis added a commit that referenced this issue Jan 9, 2023
…uire_confirm (#1887)

* fix(#1878): nvim frozen on no name buffer when modified.enable (#1879)

* feat(api): add api.config.mappings.active, api.config.mappings.default (#1876)

* feat(api): add config.mappings.current and config.mappings.default

* feat(api): add config.mappings.current and config.mappings.default

* feat(api): add config.mappings.current and config.mappings.default

* Implement turning off y/n prompt for file deletion

* Refactor different prompt configs to single ui table

* Remove unused fields

* add ui.confirm doc, format/tidy

* trash.require_confirm -> ui.confirm.trash

* Fix nil value trash field

Co-authored-by: Richard Li <[email protected]>
Co-authored-by: Telman Babayev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant