]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
[spellcheck] v0.9.1
authorJakub Wilk <redacted>
Fri, 25 Sep 2020 18:38:34 +0000 (20:38 +0200)
committerbw1 <redacted>
Thu, 23 Dec 2021 00:17:52 +0000 (01:17 +0100)
scripts/spellcheck.pl

index 850defa036ac6abc6d7e65861a0eb721cb97be5d..3fc686149cb74ad5498d1954d22246f6d1f7dc4a 100644 (file)
@@ -1,5 +1,5 @@
 # Copyright © 2008 Jakub Jankowski <shasta@toxcorp.com>
-# Copyright © 2012-2019 Jakub Wilk <jwilk@jwilk.net>
+# Copyright © 2012-2020 Jakub Wilk <jwilk@jwilk.net>
 # Copyright © 2012 Gabriel Pettier <gabriel.pettier@gmail.com>
 #
 # 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*$/;
git clone https://git.99rst.org/PROJECT