Skip to content

Commit 6fd9997

Browse files
committed
Remove the count variable from bazel#Execute
problem: E46: Cannot change read-only variable "count" solution: Remove the count variable By default using "let var = value" tries to set the internal variable var. To set the local variable, l: prefix should be used i.e. "let l:var = value". This issue only affected vim and not neovim. Closes #4
1 parent 761890e commit 6fd9997

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

autoload/bazel.vim

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,15 @@ function! bazel#Execute(action, ...) abort
9292
let targets = []
9393

9494
let i = 0
95-
let count = len(a:000)
9695

9796
" Add all arguments that start with "--" to flags
98-
while i < count && a:000[i] =~ "^--."
97+
while i < a:0 && a:000[i] =~ "^--."
9998
call add(flags, a:000[i])
10099
let i = i + 1
101100
endwhile
102101

103102
" Add everything until we find "--" to targets
104-
while i < count && a:000[i] !~ "^--"
103+
while i < a:0 && a:000[i] !~ "^--"
105104
call add(targets, a:000[i])
106105
let i = i + 1
107106
endwhile

0 commit comments

Comments
 (0)