[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode 6b48a94 165/468: Second part of the fix for #34
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode 6b48a94 165/468: Second part of the fix for #34 |
Date: |
Thu, 5 Aug 2021 04:58:29 -0400 (EDT) |
branch: elpa/lua-mode
commit 6b48a94bb46722c916032d30212e7a8581a007f2
Author: Vedat Hallac <vedathallac@gmail.com>
Commit: Vedat Hallac <vedathallac@gmail.com>
Second part of the fix for #34
Indent closing lines of multi-line comments according to opening line.
---
lua-mode.el | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index 277f955..bc95549 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.
- [nongnu] elpa/lua-mode af50eca 195/468: Bump copyright information (no luck with FSF), rephrase comment, (continued)
- [nongnu] elpa/lua-mode af50eca 195/468: Bump copyright information (no luck with FSF), rephrase comment, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 918f297 072/468: rename: lua-calculate-indentation-left-shift -> lua-calculate-unindentation, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode cf2f42a 076/468: .gitignore: ignore emacs backups, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 9384855 093/468: lua-mark-all-multiline-literals: run when during lua-mode initialization, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6de08c0 090/468: Update TODO, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode e3a8282 099/468: Make URL/Version fields in lua-mode.el prettier, update parse expression in Makefile, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 1c37d0d 114/468: Bump version, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode e17a48c 126/468: Give credit to people participated recently, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode dcf5fc1 138/468: Indentation fixes and tidy up., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 3c8cfe6 160/468: Add credit, reformat new code to fit into 77 cols, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6b48a94 165/468: Second part of the fix for #34,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode 7a3a5f6 169/468: Add script to facilitate indentation testing, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 7f8e519 178/468: Add backward compatibility aliases for cl-assert & cl-labels functions, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode e6a46ee 182/468: Update README.md, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 4b407cc 203/468: Print 'Prefix key set to ...' only when setting via interactive function, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 88b0ec3 209/468: Fix indentation for blocks starting on continued lines, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 32b5639 210/468: Fix wrong imenu generic expression, add one more regexp to match 'x = function(...)' definitions, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 57d3e46 212/468: lua-mode.el: bump "Version:" field, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode c7c8d0c 179/468: Fix bug with lua-mode-syntax-table initialization, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 0b4ae97 184/468: Merge branch 'fix-36' of git://github.com/vhallac/lua-mode, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 562540e 073/468: Fix lua-calculate-indentation: indent to 0 when inside string literal, Philip Kaludercic, 2021/08/05