diff options
author | Peter Stephenson <pws@zsh.org> | 2015-12-15 12:41:09 +0000 |
---|---|---|
committer | Peter Stephenson <pws@zsh.org> | 2015-12-15 12:41:20 +0000 |
commit | 0bd903abcad6634757e775dcb9dfb9791c53df47 (patch) | |
tree | 3489de4805ba61e4cc5bc5d3f2ecd92ecfa59df1 /Test | |
parent | d397e3fca2fbe303f949d97e0ad7abeaf6adbb6a (diff) | |
download | zsh-0bd903abcad6634757e775dcb9dfb9791c53df47.tar.gz zsh-0bd903abcad6634757e775dcb9dfb9791c53df47.tar.xz zsh-0bd903abcad6634757e775dcb9dfb9791c53df47.zip |
37405: Fix self-insert binding for multibyte sequences.
This makes it work even if the self-insert applies to a sequence longer than an initial byte, including the case of a complete binding to a full character sequence.
Diffstat (limited to 'Test')
-rw-r--r-- | Test/X03zlebindkey.ztst | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Test/X03zlebindkey.ztst b/Test/X03zlebindkey.ztst index 70c42f9c2..e6fead586 100644 --- a/Test/X03zlebindkey.ztst +++ b/Test/X03zlebindkey.ztst @@ -1,13 +1,12 @@ # Tests of the vi mode of ZLE %prep - mb_ok= + ZSH_TEST_LANG= langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8 $(locale -a 2>/dev/null | egrep 'utf8|UTF-8')) for LANG in $langs; do if [[ é = ? ]]; then ZSH_TEST_LANG=$LANG - mb_ok=1 break; fi done @@ -29,7 +28,7 @@ >BUFFER: foo >CURSOR: 3 - if [[ -z $mb_ok ]]; then + if [[ -z $ZSH_TEST_LANG ]]; then ZTST_skip="bindkey multibyte test skipped" else zpty_run 'alias unbind="bindkey -r ホ"' @@ -37,9 +36,17 @@ zletest 'ホ' zpty_run unbind zletest 'ホ' + zpty_run 'bindkey ホ self-insert' + zletest 'ホ' + zpty_run unbind + zletest 'ホ' fi 0:bindkey -s multibyte characters >BUFFER: bar >CURSOR: 3 >BUFFER: ホ >CURSOR: 1 +>BUFFER: ホ +>CURSOR: 1 +>BUFFER: ホ +>CURSOR: 1 |