branch: elpa/lua-mode
commit 45a881d6121834097ecc92cbbbbc3efa7dcf60d9
Author: immerrr <[email protected]>
Commit: immerrr <[email protected]>
lua-search-documentation: fix 'foo.bar' lookups broken when making '.'
punctuation
---
lua-mode.el | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/lua-mode.el b/lua-mode.el
index 314a28d..fc7e52a 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -1708,10 +1708,17 @@ Otherwise, return START."
(interactive)
(delete-windows-on lua-process-buffer))
+(defun lua-funcname-at-point ()
+ "Get current Name { '.' Name } sequence."
+ ;; FIXME: copying/modifying syntax table for each call may incur a penalty
+ (with-syntax-table (copy-syntax-table)
+ (modify-syntax-entry ?. "_")
+ (current-word t)))
+
(defun lua-search-documentation ()
"Search Lua documentation for the word at the point."
(interactive)
- (browse-url (concat lua-search-url-prefix (current-word t))))
+ (browse-url (concat lua-search-url-prefix (lua-funcname-at-point))))
(defun lua-toggle-electric-state (&optional arg)
"Toggle the electric indentation feature.