mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-08 19:31:14 -03:00
Don't fire variable set event before entering a for-loop
Since #4376, for-loops would set the loop variable outside, so it stays valid. They did this by doing the equivalent of ```fish set -l foo $foo for foo in 1 2 3 ``` And that first imaginary `set -l` would also fire a set-event. Since there's no use for it and the variable isn't actually set, we remove it. Fixes #8384.
This commit is contained in:
@@ -32,3 +32,14 @@ begin
|
||||
end
|
||||
echo $k
|
||||
# CHECK: global
|
||||
|
||||
function foo --on-variable foo
|
||||
echo foo set
|
||||
end
|
||||
|
||||
for foo in 1 2 3
|
||||
true
|
||||
end
|
||||
# CHECK: foo set
|
||||
# CHECK: foo set
|
||||
# CHECK: foo set
|
||||
|
||||
Reference in New Issue
Block a user