From: Jakub Wilk Date: Fri, 25 Sep 2020 18:38:34 +0000 (+0200) Subject: [spellcheck] v0.9.1 X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=6bdc97d9a4c9c2282cdc4664babbd2da4b866ac7;p=irssi-scripts.irssi.org.git [spellcheck] v0.9.1 --- diff --git a/scripts/spellcheck.pl b/scripts/spellcheck.pl index 850defa..3fc6861 100644 --- a/scripts/spellcheck.pl +++ b/scripts/spellcheck.pl @@ -1,5 +1,5 @@ # Copyright © 2008 Jakub Jankowski -# Copyright © 2012-2019 Jakub Wilk +# Copyright © 2012-2020 Jakub Wilk # Copyright © 2012 Gabriel Pettier # # This program is free software; you can redistribute it and/or modify @@ -20,7 +20,7 @@ use Irssi::TextUI; use Encode; use Text::Aspell; -$VERSION = '0.9'; +$VERSION = '0.9.1'; %IRSSI = ( authors => 'Jakub Wilk, Jakub Jankowski, Gabriel Pettier, Nei', name => 'spellcheck', @@ -167,9 +167,13 @@ sub spellcheck_key_pressed # check if inputline starts with any of cmdchars # we shouldn't spell-check commands + # (except /SAY and /ME) my $cmdchars = Irssi::settings_get_str('cmdchars'); - my $re = qr/^[\Q$cmdchars\E]/; - return if ($inputline =~ $re); + my $re = qr{^(?: + [\Q$cmdchars\E] (?i: say | me ) \s* \S | + [^\Q$cmdchars\E] + )}x; + return if ($inputline !~ $re); # get last bit from the inputline my ($word) = $inputline =~ /\s*(\S+)\s*$/;