From 3322a447894b7c5fee6f30ea725fda2f79158594 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Fri, 15 Oct 2010 01:58:32 +0200 Subject: vim_mode: Fix :set for boolean values. --- vim-mode/vim_mode.pl | 9 ++++++--- 1 file 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'); -- cgit v1.2.3