Skip to content

Commit 95c64bb

Browse files
committed
Add doc for lua-find-matching-token-word
1 parent 99312b8 commit 95c64bb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lua-mode.el

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,15 @@ TOKEN-TYPE determines where the token occurs on a statement. open indicates that
10221022
(lua-find-regexp 'backward lua-block-regexp))
10231023

10241024
(defun lua-find-matching-token-word (token &optional direction)
1025+
"Find matching open- or close-token for TOKEN in DIRECTION.
1026+
Point 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+
1033+
DIRECTION has to be either 'forward or 'backward."
10251034
(let* ((token-info (lua-get-block-token-info token))
10261035
(match-type (lua-get-token-type token-info))
10271036
;; If we are on a middle token, go backwards. If it is a middle or open,

0 commit comments

Comments
 (0)