emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/lua-mode 83ec53d 430/468: `lua-funcname-at-point': be more


From: Philip Kaludercic
Subject: [nongnu] elpa/lua-mode 83ec53d 430/468: `lua-funcname-at-point': be more strict
Date: Thu, 5 Aug 2021 04:59:23 -0400 (EDT)

branch: elpa/lua-mode
commit 83ec53dedd6d9a64f780680aa3fb3eb7c7e482d8
Author: Nikita Bloshchanevich <nikblos@outlook.com>
Commit: Nikita Bloshchanevich <nikblos@outlook.com>

    `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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]