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

Cannot change read-only variable “count” #4

Closed
dpo opened this issue Jun 16, 2021 · 4 comments
Closed

Cannot change read-only variable “count” #4

dpo opened this issue Jun 16, 2021 · 4 comments

Comments

@dpo
Copy link

dpo commented Jun 16, 2021

Thanks for this plugin! The first time I try to run :Bazel build //some/target/..., I get

Error detected while processing function bazel#Execute:
line 5:
E46: Cannot change read-only variable “count”

Hope the fix is easy.

@lakshayg
Copy link
Owner

lakshayg commented Jun 16, 2021

I'm not sure what the issue is since I don't get this error. Can you share some more details about your vim version, how you installed it, the OS you are using and/or a minimal example to reproduce this issue.

Just a shot in the dark, but could you try using the branch issue-4 instead of master and see if that fixes your issue.

@dpo
Copy link
Author

dpo commented Jun 16, 2021

Yes, the command now works! Many thanks! I’m on LInux and installed via vim-plug. The combination with vim-dispatch is awesome!

@lakshayg
Copy link
Owner

Interesting. I'm still curious why that issue happened. All I did was change a variable name from count to num_args. Could you please:

  1. Post what version of vim/neovim you are using
  2. Try changing back to the master branch and see if the issue comes back. This is to rule out the possibility of this being some first-time-use issue
  3. Pull the issue-4 branch once more. If it still works, I'll merge it into master

@lakshayg
Copy link
Owner

lakshayg commented Jun 16, 2021

You can ignore the last comment. I was able to reproduce this issue in vim. I had been using neovim up until now.

Also found this: SidOfc/mkdx#101 (comment). The "problem" with modifying count is the intended behaviour.

It seems that, if you use let count = in regular vim, it trips because it thinks I'm trying to modify an internal variable v:count:
... apparently using let without l: overwrites internal variables by default (:h let)

I'll push a fix to master shortly.

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

2 participants