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

Always populate watches key #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cincodenada
Copy link
Contributor

As mentioned in the commit note, this shouldn't usually be a problem, but I reloaded nodeinspect.vim when doing other debugging and started getting an error about the watches key missing. Since we do access it without checking, I figure it might as well just set watches to an empty object from file init.

While here I also noticed that there was an unnecessary loop, presumably left over from earlier refactoring, and also some spacing inconsistency, so I fixed up the spacing and added modelines to hopefully keep things more consistent moving forward.

The initializing isn't usually necessary, but I sourced
`nodeinspect.vim` when tracking down other issues, which broke the
watches because then `s:session["watches"]` didn't exist any more.

If we already set s:session["watches"] = {} on startup, there's no
reason to not set it in the init that I can see. I left the set in
loadSessionFile() in as well, in case there's some edge case where we
are loading a session file and don't want to merge with some existing
session watches or something.

Also, we were unnecessarily looping through the keys and calling
AddBulk() with the same argument multiple times. It was idempotent so it
was fine, but it's also not useful, and I imagine left over from some
previous restructuring.
There were a bunch of little spaces that crept in
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

Successfully merging this pull request may close these issues.

1 participant