From aa885ffb4662eb8d50a0b63853c75799c9b140bc Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 31 Mar 2016 03:22:34 -0400 Subject: [PATCH] lua: fix function/end autopairing --- modules/module-lua.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/module-lua.el b/modules/module-lua.el index cec820fa8..dc247029a 100644 --- a/modules/module-lua.el +++ b/modules/module-lua.el @@ -23,7 +23,10 @@ (sp-local-pair "then" "end" :when '(("RET")) :post-handlers '("||\n[i]")) (sp-local-pair "do" "end" :when '(("RET")) :post-handlers '("||\n[i]")) - (sp-local-pair "function" " end" :post-handlers '(("[d-1] |()\n[i]\n[i]" "RET") ("|() " "SPC"))))) + ;; block functions + (sp-local-pair "function" "end" :when '(sp-point-after-bol-p) :post-handlers '(" |\n[i]")) + ;; inline functions + (sp-local-pair "function " " end" :unless '(sp-point-after-bol-p)))) (define-minor-mode love-mode "Buffer local minor mode for Love2D"