summaryrefslogtreecommitdiff
path: root/.emacs.d/lisp/lua-mode.el
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d/lisp/lua-mode.el')
-rw-r--r--.emacs.d/lisp/lua-mode.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/.emacs.d/lisp/lua-mode.el b/.emacs.d/lisp/lua-mode.el
index 91fd0a4..af94a13 100644
--- a/.emacs.d/lisp/lua-mode.el
+++ b/.emacs.d/lisp/lua-mode.el
@@ -1022,6 +1022,15 @@ TOKEN-TYPE determines where the token occurs on a statement. open indicates that
1022 (lua-find-regexp 'backward lua-block-regexp)) 1022 (lua-find-regexp 'backward lua-block-regexp))
1023 1023
1024(defun lua-find-matching-token-word (token &optional direction) 1024(defun lua-find-matching-token-word (token &optional direction)
1025 "Find matching open- or close-token for TOKEN in DIRECTION.
1026Point has to be exactly at the beginning of TOKEN, e.g. with | being point
1027
1028 {{ }|} -- (lua-find-matching-token-word \"}\" 'backward) will return
1029 -- the first {
1030 {{ |}} -- (lua-find-matching-token-word \"}\" 'backward) will find
1031 -- the second {.
1032
1033DIRECTION has to be either 'forward or 'backward."
1025 (let* ((token-info (lua-get-block-token-info token)) 1034 (let* ((token-info (lua-get-block-token-info token))
1026 (match-type (lua-get-token-type token-info)) 1035 (match-type (lua-get-token-type token-info))
1027 ;; If we are on a middle token, go backwards. If it is a middle or open, 1036 ;; If we are on a middle token, go backwards. If it is a middle or open,