Skip to content

Add support for local variables for loop events (While, For Each...) and loop index variable#8273

Merged
4ian merged 8 commits intomasterfrom
cursor/loop-events-local-and-index-f89f
Feb 15, 2026
Merged

Add support for local variables for loop events (While, For Each...) and loop index variable#8273
4ian merged 8 commits intomasterfrom
cursor/loop-events-local-and-index-f89f

Conversation

@4ian
Copy link
Copy Markdown
Owner

@4ian 4ian commented Feb 14, 2026

  • Add support for local variables to all these events
  • Add support for local variables for all variables of "For Each Child Variable"
  • Add support for adding a "loop counter" variable. This is actually a local variable.
image image

Some examples:

image image image

cursoragent and others added 2 commits February 14, 2026 10:46
Co-authored-by: Florian Rival <4ian@users.noreply.github.com>
Co-authored-by: Florian Rival <4ian@users.noreply.github.com>
@cursor
Copy link
Copy Markdown

cursor bot commented Feb 14, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@4ian 4ian changed the title Loop events local and index Add support for local variables for loop events (While, For Each...) and loop index variable Feb 14, 2026
@4ian
Copy link
Copy Markdown
Owner Author

4ian commented Feb 15, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e4a485926c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +2424 to +2427
editedVariableLoopEvent
? newName => {
editedVariableLoopEvent.setIndexVariableName(newName);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Make loop index edits honor dialog cancel

The onRenameIndexVariable handler mutates editedVariableLoopEvent immediately while the local-variables dialog is open, but LocalVariablesDialog cancel restoration only serializes/unserializes the variables container. If the user renames/removes the loop counter and presses Cancel, the variable data is reverted but indexVariableName stays modified, leaving the loop event referencing the wrong variable (or no local variable at all) and changing runtime behavior unexpectedly.

Useful? React with 👍 / 👎.

@4ian 4ian merged commit 6bb56c6 into master Feb 15, 2026
5 of 6 checks passed
@4ian 4ian deleted the cursor/loop-events-local-and-index-f89f branch February 15, 2026 15:14
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.

2 participants