[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode 430679c 433/468: `lua-funcname-at-point': handle
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode 430679c 433/468: `lua-funcname-at-point': handle identifiers before |
Date: |
Thu, 5 Aug 2021 04:59:24 -0400 (EDT) |
branch: elpa/lua-mode
commit 430679ce887b247b605822468a81234bbde4eaf7
Author: Nikita Bloshchanevich <nikblos@outlook.com>
Commit: Nikita Bloshchanevich <nikblos@outlook.com>
`lua-funcname-at-point': handle identifiers before
Now also handle identifiers that are before point: "table.insert|".
---
lua-mode.el | 8 +++++++-
test/test-funcname-at-point.el | 4 ++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index a3389d7..28123aa 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -2018,9 +2018,15 @@ Create a Lua process if one doesn't already exist."
(when (buffer-live-p lua-process-buffer)
(delete-windows-on lua-process-buffer)))
+(defun lua--funcname-char-p (c)
+ "Check if character C is part of a function name.
+Return nil if C is nil. See `lua-funcname-at-point'."
+ (and c (string-match-p "\\`[A-Za-z_.]\\'" (string c))))
+
(defun lua-funcname-at-point ()
"Get current Name { '.' Name } sequence."
- (when (looking-at-p "[A-Za-z_.]")
+ (when (or (lua--funcname-char-p (char-before))
+ (lua--funcname-char-p (char-after)))
(save-excursion
(save-match-data
(re-search-backward "\\`\\|[^A-Za-z_.]")
diff --git a/test/test-funcname-at-point.el b/test/test-funcname-at-point.el
index a73b368..0ca220a 100644
--- a/test/test-funcname-at-point.el
+++ b/test/test-funcname-at-point.el
@@ -23,9 +23,9 @@
(with-temp-buffer
(save-excursion (insert "table.insert."))
(expect (lua-funcname-at-point) :to-equal "table.insert")))
- (it "ignores identifiers before point"
+ (it "handles identifiers before point"
(with-temp-buffer
(insert "table.insert.")
- (expect (lua-funcname-at-point) :to-be nil))))
+ (expect (lua-funcname-at-point) :to-equal "table.insert"))))
;;; test-funcname-at-point.el ends here
- [nongnu] elpa/lua-mode 3f7a032 300/468: Move .nosearch in test/, (continued)
- [nongnu] elpa/lua-mode 3f7a032 300/468: Move .nosearch in test/, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode ca24f4c 302/468: Add `run-lua` alias, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 530aa9f 303/468: Merge pull request #97 from marsam/master, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 92d9729 307/468: Add init-tryout.el to persistent initialization code, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 04a2772 310/468: Fix goto label fontification, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode fbad628 316/468: Add travis.yml, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6b32777 413/468: assignment statements: unindent closing parenthesis on right hand side, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6638de0 437/468: Merge pull request #182 from immerrr/enable-ci-via-github-actions, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode a4f49d3 438/468: Consider point as inside comment if it is inside "--" opener, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 3a0fb4b 431/468: `lua-funcname-at-point': add tests, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 430679c 433/468: `lua-funcname-at-point': handle identifiers before,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode 432d9a0 333/468: lua-try-match-multiline-begin: reword the comment, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode ecfe465 352/468: Remove testing for Emacs < 24.3, and add 25.2 and 25.3, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 99312b8 365/468: Merge pull request #134 from velkyel/master, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 4342dd1 372/468: Fix compatibility with new rx package from Emacs 27, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 50d94a4 373/468: tests: silence "Indenting region..." messages, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d746b7e 381/468: Fix typos, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode dc30240 384/468: Merge pull request #160 from tarsiiformes/typo, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 4db05e8 389/468: Use cl-lib instead of cl, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 3f67365 394/468: Renamed word “Result” to “Actual” in matcher's message, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 658bf8f 397/468: Merge pull request #166 from veprbl/patch-1, Philip Kaludercic, 2021/08/05