From 67b377d92ace6d119bd83867b70e55c4383fc63f Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Thu, 5 May 2011 08:10:25 +0100 Subject: vim-mode/vim_mode: added :set [no]option for booleans. Needs testing (which can't be done until I unbreak the input system :( --- vim-mode/vim_mode.pl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index becf13b..51094aa 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -3298,6 +3298,21 @@ sub _setting_get { sub _setting_set { my ($name, $value) = @_; + # support the vim convention of no as a way to unset booleans. + if ($name =~ m/^no(.*)/) { + my $actual_name = $1; + eval { + use warnings FATAL => qw/all/; + my $val = settings_get_bool($actual_name); + }; + if ($@ =~ m/not found/) { + _debug("setting $name ($actual_name)) not found, ignoring"); + return; + } + $name = $actual_name; + $value = 0; + } + my $type = $settings->{$name}->{type}; $name = "vim_mode_$name"; -- cgit v1.2.3