Closed gpcureton closed 3 years ago
interesting.
So this is obvi bad. This shouldn't happen.
Let me try to figure out what is going on, as I think that its to do with an empty projct with no config :)
My very big sorries for not getting back sooner. I didn't have noti's turned on and missed it :(
I am unable to repro, are you on the latest version?
I have been making tons of changes. We are not quite at 1.0, so expect some churn in the immediate future.
I'll make a quick change that could help, but unsure why its required (as I don't know why its happening for you). Effectively your cache, for your project, is present, but doesn't have a marks
list. This puzzles me :)
I was on the latest version of harpoon
at the time. I just did an update and had the same issue, which threw up as soon as PlugUpdate
finished running and I tried to leave the vim-plug
buffer. I'm going to consider your comment about the marks
list and see of I can figure out if there's something in my neovim config which is borking things in that respect. Feel free to close as un-repro, I'll loiter around in the discord, and re-post if I discover something actionable.
Let me create a quick PR to make sure this all works. Somehow, some state got goofed. I really appreciate you taking the time at all. Its very kind to do so.
NP, I just wish I understood the guts of neovim better so I could be a bit more constructive than "stuff's broken" :-)
REPRO'D!
Give me a moment to fix this.
Ok, I believe I have officially fixed it. Could you verify @gpcureton ?
@ThePrimeagen Sorry, I'm still getting the same error.
F
@gpcureton did you :PlugUpdate
? Do you know the hash? Does it match the current hash of master?
The problem was new projects or previous configured projects. And I thought I addressed it. But alas and alack. I must of screwed up.
Dang it, I should take more time in answering things. Could you link me the newly moved error? (It sohuld of at least moved lines).
Ohh! I may have found it!
Is this what you are seeing?
@ThePrimeagen I did a :PlugClean
and PlugUpdate
a few times to make sure I was getting the latest. I'm getting the error
Error detected while processing BufLeave Autocommands for "*":
E5108: Error executing lua ...onfig/nvim/autoload/plugged/harpoon/lua/harpoon/mark.lua:34: attempt to get length of field 'marks' (a nil value)
for the hash a48aa25
.
@gpcureton So sorry for this churn.
I believe I have it solved now. I have tried new projects with both terminal and marking with no errors. Mind you trying one more time?
Also, this shows me how important it is for me to create a logging mechanism
NP, glad to help. For posterity, some actions which trigger the error:
startify
, and selecting a filenvim file.py
to open a file directly, then making a split and doing :e different_file.py
:Fern . -drawer -toggle
breaks, because trying to open a split I guess?Just tried a41b1c9
, getting
Error detected while processing BufLeave Autocommands for "*":
E5108: Error executing lua ...onfig/nvim/autoload/plugged/harpoon/lua/harpoon/mark.lua:40: attempt to get length of fiel
d 'marks' (a nil value)
It moved at least :-)
My config is at https://gitlab.ssec.wisc.edu/geoffc/neovim_config , if that's something that proves useful.
Thank you thank you! Let me play around with this.
I assume it must be something unique here.
Could you also cat your ~/.local/shared/nvim/harpoon.json (or wherever your XDG_DATA_PATH is (i think thtas the path))
echo stdpath("data")
btw, your config is just a blank repo for me.
Do I need permissions?
Got it!
It turns out I call require('harpoon').setup({ ... })
You must not!
I have the error now. Thank you!
That repo is supposed to be public. I have it mirrored at https://github.com/gpcureton/neovim-config , try that.
My XDG_DATA_PATH
isn't defined, but I have the following in ~/.local/share/nvim/harpoon.json
{"projects": {"/home/geoffc/tmp/test_proj": {"mark": {"marks": []}, "term": {"cmds": []}}, "/home/geoffc": {"mark": {"marks": []}, "term": {"cmds": []}}, "/home/geoffc/SSEC/git/neovim_config": {"mark": {"marks": []}, "term": {"cmds": []}}}}
I should add that I haven't actually tried using harpoon yet, I was wondering if I was doing something off-label, but I hadn't gotten to that point yet.
@gpcureton Its not your fault. Its mine.
I literally made the init flow run through setup. This is problematic as you may never call setup. Obviously I need to make things more robust. I'll have to fix this tonight. Its a bit more involved.
I put...
lua << EOF
require('harpoon').setup {}
EOF
into a file which is sourced by my init.vim
, and BOOM! Error went away. Because I hadn't started fiddling with harpoon yet my config for it was blank.
Teamwork makes the dream work ;-)
I believe its fixed. Closing with supreme confidence.
I've been getting a very similar error message from a new standard (afaik) attempt to follow the complete nvim setup video. In an attempt to reinstall Harpoon without going completely back to square one, I've done the basics:
after/plugin/harpoon.lua
To no avail. Also tried the same general approach to remove harpoon and plenary, and then all three of harpoon, plenary, and telescope. On that last try, I uncommented it only in the packer.lua, leaving the entire after/plugin/harpoon.lua still commented. A simple :lua require("harpoon.mark")
on the vim command line was enough to put it back in this bad state.
My full error message:
Error detected while processing BufLeave Autocommands for "*":
Error executing lua callback: ...nvim/site/pack/packer/start/harpoon/lua/harpoon/init.lua:115: attempt to index local 'projects' (a nil value)
stack traceback:
...nvim/site/pack/packer/start/harpoon/lua/harpoon/init.lua:115: in function 'ensure_correct_config'
...nvim/site/pack/packer/start/harpoon/lua/harpoon/init.lua:248: in function 'refresh_projects_b4update'
...nvim/site/pack/packer/start/harpoon/lua/harpoon/init.lua:171: in function 'save'
...nvim/site/pack/packer/start/harpoon/lua/harpoon/mark.lua:18: in function 'emit_changed'
...nvim/site/pack/packer/start/harpoon/lua/harpoon/mark.lua:281: in function 'store_offset'
...nvim/site/pack/packer/start/harpoon/lua/harpoon/init.lua:20: in function <...nvim/site/pack/packer/start/harpoon/lua/harpoon/init.lua:19>
By comparison I set up another Mac (personal vs. work) going back to the beginning and got it working fine. There the projects attribute is populated. I'll have to dig to find out why there is this discrepancy.
Eventually I got harpoon working but only after removing (actually stashing away on a different path) the entirety of .local/share/nvim
and doing the config from scratch. My nvim intuition isn't good but my guess is something under site/pack/packer/start
was retaining whatever it was that was causing the problem.
Anyway all good for harpoon but I may never know the root cause. Good thing the video made it so fast to reconfig!
After installing
harpoon
, I get the following error when running:bnext
,:bprev
,:CocCommand explorer
etc...I'm using Neovim nightly
v0.5.0-dev+1097-g18f90336c
.