mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 04:41:14 -03:00
Send events more often for variable sets outside of builtin_set
When changing certain variables programmatically, ensure that events are sent. Fixes #6653
This commit is contained in:
36
tests/bind_mode_events.expect
Normal file
36
tests/bind_mode_events.expect
Normal file
@@ -0,0 +1,36 @@
|
||||
# vim: set filetype=expect:
|
||||
spawn $fish
|
||||
expect_prompt
|
||||
|
||||
send "set -g fish_key_bindings fish_vi_key_bindings\r"
|
||||
expect_prompt
|
||||
|
||||
send "echo ready to go\r"
|
||||
expect_prompt -re {\r\nready to go\r\n} {
|
||||
puts "ready to go"
|
||||
}
|
||||
send "function add_change --on-variable fish_bind_mode ; set -g MODE_CHANGES \$MODE_CHANGES \$fish_bind_mode ; end\r"
|
||||
expect_prompt
|
||||
|
||||
# normal mode
|
||||
send "\033"
|
||||
sleep 0.050
|
||||
|
||||
# insert mode
|
||||
send "i"
|
||||
sleep 0.050
|
||||
|
||||
# back to normal mode
|
||||
send "\033"
|
||||
sleep 0.050
|
||||
|
||||
# insert mode again
|
||||
send "i"
|
||||
sleep 0.050
|
||||
|
||||
send "echo mode changes: \$MODE_CHANGES\r"
|
||||
expect_prompt -re {\r\nmode changes: default insert default insert\r\n} {
|
||||
puts "Correct mode changes"
|
||||
} unmatched {
|
||||
puts "Incorrect mode changes"
|
||||
}
|
||||
0
tests/bind_mode_events.expect.err
Normal file
0
tests/bind_mode_events.expect.err
Normal file
2
tests/bind_mode_events.expect.out
Normal file
2
tests/bind_mode_events.expect.out
Normal file
@@ -0,0 +1,2 @@
|
||||
ready to go
|
||||
Correct mode changes
|
||||
Reference in New Issue
Block a user