diff options
| author | Simon Ruderich <simon@ruderich.org> | 2010-10-14 23:58:32 +0000 | 
|---|---|---|
| committer | Simon Ruderich <simon@ruderich.org> | 2010-10-14 23:58:32 +0000 | 
| commit | 3322a447894b7c5fee6f30ea725fda2f79158594 (patch) | |
| tree | e24f0a3c3d4d6075998d4f2c6761cc1c8b19c504 /vim-mode | |
| parent | vim_mode: Fix :setting empty values. (diff) | |
| download | irssi-scripts-3322a447894b7c5fee6f30ea725fda2f79158594.tar.gz irssi-scripts-3322a447894b7c5fee6f30ea725fda2f79158594.zip | |
vim_mode: Fix :set for boolean values.
Diffstat (limited to 'vim-mode')
| -rw-r--r-- | vim-mode/vim_mode.pl | 9 | 
1 files changed, 6 insertions, 3 deletions
| diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index ce9405d..1f7fb14 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -1924,9 +1924,12 @@ sub ex_set {              my $name = $1;              my $value = $2;              # Also accept numeric values for boolean options. -            if ($settings->{$name}->{type} == S_BOOL and -                    $value !~ /^(on|off)$/i) { -                $value = $value ? 'on' : 'off'; +            if ($settings->{$name}->{type} == S_BOOL) { +                if ($value =~ /^(on|off)$/i) { +                    $value = lc $value eq 'on' ? 1 : 0; +                } elsif ($value eq '') { +                    $value = 0; +                }              }              _setting_set($name, $value);              Irssi::signal_emit('setup changed'); | 
