Skip to content

Fix multiple :set-option commands in keybinding sequences - #15860

Open
Dronakurl wants to merge 2 commits into
helix-editor:masterfrom
Dronakurl:multi-set-option
Open

Dronakurl wants to merge 2 commits into
helix-editor:masterfrom
Dronakurl:multi-set-option

Conversation

@Dronakurl

Copy link
Copy Markdown

Problem: When using a keybinding with multiple :set-option commands in a sequence, only the last option takes effect. For example:

[keys.normal]
space.x = [":set-option end-of-line-diagnostics error", ":set-option inline-diagnostics.cursor-line error"]

Only inline-diagnostics.cursor-line would be set, while end-of-line-diagnostics would retain its previous value.

The issue occurred because all commands in a sequence would read the same initial config state (before any updates were applied), create full config replacements, and send them. The last event would overwrite all previous changes.

Solution

Adds ConfigEvent::UpdateField variant for incremental config field updates. Commands now send individual field updates (key path + value) which the application applies sequentially, allowing them to compose correctly.

Related

@Dronakurl
Dronakurl marked this pull request as ready for review June 9, 2026 20:32
@Dronakurl
Dronakurl marked this pull request as draft June 10, 2026 05:07
@Dronakurl
Dronakurl force-pushed the multi-set-option branch 2 times, most recently from 3f2d0f2 to b005d23 Compare June 10, 2026 18:03
@Dronakurl
Dronakurl marked this pull request as ready for review June 10, 2026 19:13
@Dronakurl
Dronakurl force-pushed the multi-set-option branch 2 times, most recently from 1cde260 to 734f686 Compare June 19, 2026 01:36
@Tq101510

Copy link
Copy Markdown

image

@Dronakurl
Dronakurl force-pushed the multi-set-option branch 2 times, most recently from c877796 to 4c48a61 Compare June 29, 2026 23:55
@Dronakurl
Dronakurl force-pushed the multi-set-option branch 2 times, most recently from d2adb27 to ae16a8b Compare July 8, 2026 19:32
Dronakurl and others added 2 commits October 10, 2026 19:55
> This PR was prepared with a coding agent (Mistral Vibe)

Adds ConfigEvent::UpdateField variant to allow updating individual
config
fields instead of replacing the entire config. This fixes the issue
where
multiple :set-option commands in a keybinding sequence would only apply
the last option, as each command was reading the same initial config
state and sending full config replacements.

Modified set_option and toggle_option commands to use UpdateField, and
added handling in application.rs.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
Adds 4 integration tests to verify that multiple :set and :toggle commands
in a keybinding sequence work correctly:
- test_set_config_single
- test_set_config_multi
- test_toggle_config_single
- test_toggle_config_multi

This ensures the fix for issue helix-editor#13187 works as expected.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>

This branch has not been deployed

No deployments
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.

Keybinding for multiple commands with ":set" and ":toggle" does not work as expected

2 participants