aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Feist <shabble@metavore.org>2011-05-05 07:10:25 +0000
committerTom Feist <shabble@metavore.org>2011-05-05 07:10:25 +0000
commit67b377d92ace6d119bd83867b70e55c4383fc63f (patch)
treea98c2b39e0e0d532551dc80d8b41c1e230a9c1a5
parentvim-mode/vim_mode: changed input_buf to escape_buf to more accurately represent (diff)
downloadirssi-scripts-67b377d92ace6d119bd83867b70e55c4383fc63f.tar.gz
irssi-scripts-67b377d92ace6d119bd83867b70e55c4383fc63f.zip
vim-mode/vim_mode: added :set [no]option for booleans. Needs testing (which
can't be done until I unbreak the input system :(
Diffstat (limited to '')
-rw-r--r--vim-mode/vim_mode.pl15
1 files changed, 15 insertions, 0 deletions
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<param> 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";