mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-12-07 06:02:21 +01:00
53368: ignore no-op changes to EMACS/VI options
This commit is contained in:
parent
eb8e217f1b
commit
d315401a03
2 changed files with 11 additions and 1 deletions
|
|
@ -887,8 +887,14 @@ dosetopt(int optno, int value, int force, char *new_opts)
|
|||
acquire_pgrp();
|
||||
}
|
||||
} else if ((optno == EMACSMODE || optno == VIMODE) && value) {
|
||||
/* What's going on here:
|
||||
* 1) unsetopt of either emacs or vi is an effective no-op.
|
||||
* 2) setopt of either emacs or vi toggles off the other.
|
||||
* Hence we disallow changing these options in emulation mode,
|
||||
* but only if the change is setopt rather than unsetopt.
|
||||
*/
|
||||
if (sticky && sticky->emulation)
|
||||
return -1;
|
||||
return opts[optno] ? 0 : -1;
|
||||
zleentry(ZLE_CMD_SET_KEYMAP, optno);
|
||||
new_opts[(optno == EMACSMODE) ? VIMODE : EMACSMODE] = 0;
|
||||
} else if (optno == SUNKEYBOARDHACK) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue