branch: elpa/lua-mode
commit ed01d351c81c18f6d2d4d67dac416ee720946e62
Author: immerrr <[email protected]>
Commit: immerrr <[email protected]>
Implement proper syntax-status querying: improve precision a lot
---
lua-mode.el | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index 834f737..d2d1831 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -404,22 +404,17 @@ This function replaces previous prefix-key binding with a
new one."
(lua--customize-set-prefix-key 'lua-prefix-key new-key-str)
(lua-prefix-key-update-bindings))
-(defun lua-syntax-status ()
- "Returns the syntactic status of the character after the point."
- (parse-partial-sexp (line-beginning-position) (point)))
-
-
(defun lua-string-p ()
"Returns true if the point is in a string."
- (elt (lua-syntax-status) 3))
+ (elt (syntax-ppss) 3))
(defun lua-comment-p ()
"Returns true if the point is in a comment."
- (elt (lua-syntax-status) 4))
+ (elt (syntax-ppss) 4))
(defun lua-comment-or-string-p ()
"Returns true if the point is in a comment or string."
- (let ((parse-result (lua-syntax-status)))
+ (let ((parse-result (syntax-ppss)))
(or (elt parse-result 3) (elt parse-result 4))))
(defun lua-indent-line ()