branch: elpa/lua-mode
commit 83ec53dedd6d9a64f780680aa3fb3eb7c7e482d8
Author: Nikita Bloshchanevich <[email protected]>
Commit: Nikita Bloshchanevich <[email protected]>
`lua-funcname-at-point': be more strict
Only return a function name if the cursor is on a dot-delimited
identifier.
---
lua-mode.el | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index 4735b91..a3389d7 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -2020,13 +2020,14 @@ Create a Lua process if one doesn't already exist."
(defun lua-funcname-at-point ()
"Get current Name { '.' Name } sequence."
- (save-excursion
- (save-match-data
- (re-search-backward "\\`\\|[^A-Za-z_.]")
- ;; NOTE: `point' will be either at the start of the buffer or on a
- ;; non-symbol character.
- (re-search-forward "\\([A-Za-z_]+\\(?:\\.[A-Za-z_]+\\)*\\)")
- (match-string-no-properties 1))))
+ (when (looking-at-p "[A-Za-z_.]")
+ (save-excursion
+ (save-match-data
+ (re-search-backward "\\`\\|[^A-Za-z_.]")
+ ;; NOTE: `point' will be either at the start of the buffer or on a
+ ;; non-symbol character.
+ (re-search-forward "\\([A-Za-z_]+\\(?:\\.[A-Za-z_]+\\)*\\)")
+ (match-string-no-properties 1)))))
(defun lua-search-documentation ()
"Search Lua documentation for the word at the point."