From 409b80b75e4ab4cd53e1815054fe8f187c2e8559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Alexandre=20Garcia=20Correia?= Date: Mon, 21 Dec 2020 15:57:28 +0000 Subject: [PATCH] Wrap in init() This was causing an error where when launching micro it would throw an error at these lines trying to call non-function object. Wraping them in an init() seems to solve the issue and keep the functionality. --- comment.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/comment.lua b/comment.lua index 5082ccd..0e528d8 100644 --- a/comment.lua +++ b/comment.lua @@ -104,7 +104,10 @@ function string.starts(String,Start) return string.sub(String,1,string.len(Start))==Start end -MakeCommand("comment", "comment.comment") -BindKey("Alt-/", "comment.comment") +function init() + MakeCommand("comment", "comment.comment") + BindKey("Alt-/", "comment.comment") + + AddRuntimeFile("comment", "help", "help/comment-plugin.md") +end -AddRuntimeFile("comment", "help", "help/comment-plugin.md")