Skip to content

Instantly share code, notes, and snippets.

@genneko
Created June 10, 2019 05:05
Show Gist options
  • Save genneko/39f28c83a6fd9695788a44a2c0b535d9 to your computer and use it in GitHub Desktop.
Save genneko/39f28c83a6fd9695788a44a2c0b535d9 to your computer and use it in GitHub Desktop.
A patch for swatch echo action to suppress uninitialized string warnings
--- Actions.pm.orig 2019-06-10 13:45:42.577613000 +0900
+++ Actions.pm 2019-06-10 13:52:49.789538000 +0900
@@ -62,7 +62,8 @@
and $args{'THRESHOLDING'} eq 'on'
and not &Swatch::Threshold::threshold(%args));
- if (${$args{'MODES'}}[0] =~ /^normal$/i) { # for backward compatability
+ if (${$args{'MODES'}}[0] =~ /^normal$/i # for backward compatability
+ || @{$args{'MODES'}} < 1 ){
print "$args{'MESSAGE'}\n";
} else {
print colored("$args{'MESSAGE'}\n", @{$args{'MODES'}});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment