branch: elpa/lua-mode
commit 8c28ed53ec64977e56116f7e2834eebc97090c49
Author: immerrr <[email protected]>
Commit: immerrr <[email protected]>
Add utility funcs lua-inside-multiline-p and lua-get-multiline-start
---
lua-mode.el | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/lua-mode.el b/lua-mode.el
index b54a5b2..f050f2a 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -1191,6 +1191,16 @@ mark char as comment delimiter. Otherwise, remove the
mark if any."
(lua-put-char-syntax-table pos (lua-get-multiline-delim-syntax type))
(set-buffer-modified-p old-modified-p))))
+(defsubst lua-inside-multiline-p (&optional pos)
+ (let ((status (syntax-ppss pos)))
+ (or (eq (elt status 3) t) ;; inside generic string
+ (eq (elt status 7) 'syntax-table)))) ;; inside generic comment
+
+(defun lua-get-multiline-start (&optional pos)
+ (interactive)
+ (when (lua-inside-multiline-p pos) ;; return string/comment start
+ (elt (syntax-ppss pos) 8)))
+
(defun lua-unmark-multiline-literals (&optional begin end)
"Clears all Lua multiline construct markers in region