telescope-project.nvim icon indicating copy to clipboard operation
telescope-project.nvim copied to clipboard

Error update_focused_file

Open tiagovla opened this issue 3 years ago • 8 comments

Last commit b991a2ac482a31b9de7ca6b49d050b2076c1f96e introduced this error:

               E5108: Error executing lua ...vim/site/pack/packer/opt/nvim-tree.lua/lua/nvim-tree.lua:327: attempt to index field 'update_focused_file' (a nil value)
stack traceback:
        ...vim/site/pack/packer/opt/nvim-tree.lua/lua/nvim-tree.lua:327: in function 'change_dir'
        ...project.nvim/lua/telescope/_extensions/project/utils.lua:122: in function 'open_in_nvim_tree'
        ...project.nvim/lua/telescope/_extensions/project/utils.lua:131: in function 'change_project_dir'
        ...oject.nvim/lua/telescope/_extensions/project/actions.lua:103: in function 'run_replace_or_original'
        ...k/packer/opt/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'find_project_files'
        ...-project.nvim/lua/telescope/_extensions/project/main.lua:80: in function 'run_replace_or_original'
        ...k/packer/opt/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'key_func'
        ...ack/packer/opt/telescope.nvim/lua/telescope/mappings.lua:341: in function 'execute_keymap'
        [string ":lua"]:1: in main chunk

This happens when nvimtree is closed and does not happen when nvimtree is open.

tiagovla avatar Sep 09 '22 04:09 tiagovla

Is nvim-tree.lua the latest version? I didn't encounter this problem.

lijinglin3 avatar Sep 13 '22 08:09 lijinglin3

I can't reproduce the bug. It's working for me in the latest versions.

adelarsq avatar Sep 15 '22 21:09 adelarsq

I will debug it later.

tiagovla avatar Sep 15 '22 23:09 tiagovla

@tiagovla try reinstall plugin

AntoscencoVladimir avatar Oct 01 '22 21:10 AntoscencoVladimir

@tiagovla try reinstall plugin

Sorry, I forgot to update this. The problem was that I'm lazyloading nvim-tree and this plugin calls it before it is loaded.

tiagovla avatar Oct 01 '22 21:10 tiagovla

I'm really not sure why opening nvim-tree is the default behavior. A better solution IMO would be to emit an event and let the user decide if he/she wants to do something about it instead of introducing dependencies or forcing anything. Could this at least be optional?

tiagovla avatar Oct 01 '22 21:10 tiagovla

@tiagovla agreed. If you would like to submit a PR to fix this I'd be happy to approve

claidler avatar Oct 02 '22 06:10 claidler

I'm really not sure why opening nvim-tree is the default behavior. A better solution IMO would be to emit an event and let the user decide if he/she wants to do something about it instead of introducing dependencies or forcing anything. Could this at least be optional?

It's done optional for the moment in latest PR

AntoscencoVladimir avatar Oct 02 '22 10:10 AntoscencoVladimir