[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode 52dcf7b 167/468: Merge pull request #35 from vhal
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode 52dcf7b 167/468: Merge pull request #35 from vhallac/fix-34 |
Date: |
Thu, 5 Aug 2021 04:58:29 -0400 (EDT) |
branch: elpa/lua-mode
commit 52dcf7b09f2f6322fc42f97a72b7c213bd43a461
Merge: bba7fc0 612b1e7
Author: immerrr <immerrr@gmail.com>
Commit: immerrr <immerrr@gmail.com>
Merge pull request #35 from vhallac/fix-34
Merge in fix in comment indentation logic (#34)
---
lua-mode.el | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index 267277e..4f79e82 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -578,10 +578,21 @@ Return the amount the indentation changed by."
(if (and (lua-string-p) (not lua-indent-string-contents))
;; if inside string and strings aren't to be indented, return current
indentation
(current-indentation)
- ;; otherwise indent by lua-indent-level relative to the line where literal
starts
+ ;; Otherwise, indent as a comment
(save-excursion
- (goto-char (lua-get-multiline-start))
- (+ (current-indentation) lua-indent-level))))
+ (cond
+ ;; If it is the end of a multi-line comment, simply mirror the opening
+ ;; line's indent.
+ ((looking-at "\\s *\\(?:--\\)?\\]\\(?1:=*\\)\\]")
+ (re-search-backward (format "\\[%s\\["
+ (or (match-string-no-properties 1) ""))
+ (lua-get-multiline-start)
+ 'noerror)
+ (current-indentation))
+ ;; otherwise indent by lua-indent-level relative to the line where
literal starts
+ (t
+ (goto-char (lua-get-multiline-start))
+ (+ (current-indentation) lua-indent-level))))))
(defun lua-find-regexp (direction regexp &optional limit ignore-p)
"Searches for a regular expression in the direction specified.
@@ -779,7 +790,8 @@ Returns final value of point as integer or nil if operation
failed."
(while t
(unless (eql (forward-line (if back -1 1)) 0) ;; 0 means success
(throw 'found nil))
- (unless (looking-at "\\s *\\(--.*\\)?$") ;; blank lua line
+ (unless (or (looking-at "\\s *\\(--.*\\)?$")
+ (lua-comment-or-string-p))
(throw 'found (point))))))
(eval-when-compile
- [nongnu] elpa/lua-mode 532701b 298/468: Add missing Lua 5.3 functions and modules, (continued)
- [nongnu] elpa/lua-mode 532701b 298/468: Add missing Lua 5.3 functions and modules, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 445bad6 301/468: Merge pull request #92 from ramnes/master, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 7f8fbf2 308/468: lua-mode: don't remove syntax-table during unfontification, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b4943f6 313/468: Add luadoc keyword fontification (issue #71), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode debba6c 317/468: Use electric-indent-mode for per-char electric indentation, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode bdf121b 318/468: New release 20151025, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 4b5aad7 326/468: lua-try-match-multiline-begin: don't do syntax-ppss after the opener, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode a9945c9 340/468: possibility to connect to remote lua process, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 0407042 153/468: Make lua-with-silent-modifications available during byte-compilation, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b1dc70c 158/468: lua-font-lock-keywords: highlight builtin symbols (issue #15), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 52dcf7b 167/468: Merge pull request #35 from vhallac/fix-34,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode a3016a2 176/468: Avoid polluting "global namespace" when striving for backward compatibility, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b124dd0 194/468: Add field containing commit SHA expanded during archive creation., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 64c1e94 197/468: lua--builtins: add "self" as keyword, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d6c8419 202/468: Fix incorrect error highlighting in 'for x = ...' statements, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 2d94dee 204/468: Don't unindent comment close-bracket if it doesn't match open-bracket, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode c1fcfb6 211/468: Add NEWS file, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d0fa50d 217/468: lua-make-delimited-matcher: wrap into eval-and-compile, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b684790 219/468: Revert "Rename lua--function-name-rx, use it in font-lock keywords init", Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 8e19d23 231/468: Add basic indentation tests, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6729533 234/468: Rewrite lua-send-buffer function (should fix issue #60), Philip Kaludercic, 2021/08/05