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

Error update_focused_file #111

Open
tiagovla opened this issue Sep 9, 2022 · 8 comments
Open

Error update_focused_file #111

tiagovla opened this issue Sep 9, 2022 · 8 comments

Comments

@tiagovla
Copy link
Contributor

tiagovla commented Sep 9, 2022

Last commit b991a2a 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.

@lijinglin3
Copy link
Contributor

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

@adelarsq
Copy link
Contributor

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

@tiagovla
Copy link
Contributor Author

I will debug it later.

@AntoscencoVladimir
Copy link
Contributor

@tiagovla try reinstall plugin

@tiagovla
Copy link
Contributor Author

tiagovla commented Oct 1, 2022

@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
Copy link
Contributor Author

tiagovla commented Oct 1, 2022

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?

@claidler
Copy link
Collaborator

claidler commented Oct 2, 2022

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

@AntoscencoVladimir
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants