about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-09-22 17:56:46 -0500
committerFire Demon <firedemon@creature.cafe>2020-09-22 18:01:23 -0500
commitff2619973550769b455da25bf8905ea39368dd06 (patch)
tree0dc4430ecc70846eeb029480fb320b8db77ddd37 /app
parentc11bf63a05ce1d48f37806347536c628c69c72b1 (diff)
Rewrite keysmash template as a template transformer
Diffstat (limited to 'app')
-rw-r--r--app/lib/command_tag/command/text_tools.rb15
1 files changed, 7 insertions, 8 deletions
diff --git a/app/lib/command_tag/command/text_tools.rb b/app/lib/command_tag/command/text_tools.rb
index b9c3f3ad7..6b37b66b7 100644
--- a/app/lib/command_tag/command/text_tools.rb
+++ b/app/lib/command_tag/command/text_tools.rb
@@ -1,10 +1,6 @@
 # frozen_string_literal: true
 
 module CommandTag::Command::TextTools
-  def handle_000_keysmash_startup(args = [100, 100])
-    @vars['keysmash'] = [handle_keysmash_with_return(args)]
-  end
-
   def handle_code_at_start(args)
     return if args.count < 2
 
@@ -70,12 +66,11 @@ module CommandTag::Command::TextTools
       't', 'x', ',',
       'q', 'z',
       'y', 'b',
-      'p', '[',
-      '.', '/',
-      ']', '\\'
+      'p', '.',
+      '[', ']'
     ]
 
-    min_size = [[1, args[1].to_i].max, 100].min
+    min_size = [[5, args[1].to_i].max, 100].min
     max_size = [args[0].to_i, 100].min
     max_size = 33 unless max_size.positive?
 
@@ -87,4 +82,8 @@ module CommandTag::Command::TextTools
 
     chunk.join
   end
+
+  def transform_keysmash_template_return(_, args)
+    handle_keysmash_with_return([args[0], args[2]])
+  end
 end