[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode 9d86a22 254/468: Fix indentation error raised if
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode 9d86a22 254/468: Fix indentation error raised if 'else' is on the same line as 'if' |
Date: |
Thu, 5 Aug 2021 04:58:48 -0400 (EDT) |
branch: elpa/lua-mode
commit 9d86a227d1072b801cb14358b92ead853757180d
Author: immerrr <immerrr+lua@gmail.com>
Commit: immerrr <immerrr+lua@gmail.com>
Fix indentation error raised if 'else' is on the same line as 'if'
---
lua-mode.el | 4 ++--
test/test-indentation.el | 6 +++++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index 487c4cc..ca6230b 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -1284,14 +1284,14 @@ and the cdr of the replace-matching info is added in
its place. This is used
when a middle-of the block (the only case is 'else') is seen on the same line
the block is opened."
(cond
- ( (listp (cdr-safe pair))
- (nconc pair info))
( (eq 'remove-matching (car pair))
; Remove head of list
(cdr info))
( (eq 'replace-matching (car pair))
; remove head of list, and add the cdr of pair instead
(cons (cdr pair) (cdr info)))
+ ( (listp (cdr-safe pair))
+ (nconc pair info))
( t
; Just add the pair
(cons pair info))))
diff --git a/test/test-indentation.el b/test/test-indentation.el
index e9fec46..53810db 100644
--- a/test/test-indentation.el
+++ b/test/test-indentation.el
@@ -437,8 +437,12 @@ elseif baz then
a = a + 3
end
-a = 0"))
+a = 0")
+ (should-lua-indent "\
+if foo then a = a + 1 else
+ a = a + 2
+end"))
(ert-deftest lua-indentation-defun ()
;; [local] function funcname funcbody
- [nongnu] elpa/lua-mode 350acce 450/468: Don't do lua-backward-up-list calculation for overrides if not necessary, (continued)
- [nongnu] elpa/lua-mode 350acce 450/468: Don't do lua-backward-up-list calculation for overrides if not necessary, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 3e89784 454/468: Fix test suite names, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode af274e4 455/468: Merge pull request #184 from immerrr/fix-and-optimize-finding-matching-blocks, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d81c700 466/468: Bump version tag, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b9a476c 467/468: Merge pull request #194 from phikal/patch-1, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 28155ba 241/468: Update README.md, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 45a881d 243/468: lua-search-documentation: fix 'foo.bar' lookups broken when making '.' punctuation, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode f8a41b8 246/468: Fix cl-lib dependency for Emacs23 tests, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 9e200e8 247/468: Fix font-locking of functions with underscores (issue #63), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode bbab5a6 253/468: Don't anchor arglist continuation to block openers, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 9d86a22 254/468: Fix indentation error raised if 'else' is on the same line as 'if',
Philip Kaludercic <=
- [nongnu] elpa/lua-mode 2ad2ac8 256/468: lua-imenu-generic-expression add support for local function, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 8ff3427 257/468: Merge pull request #65 from guoxx/master, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 78f0e09 260/468: Make sure nested token searches begin from open-token positions, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 2cdfda7 264/468: Add inferior-test.el with some basic (failing) tests, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d166d5e 267/468: Merge remote-tracking branch 'upstream/master', Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d52e291 270/468: Don't fontify "stdin:N:" stacktrace entries in REPL buffer, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode ec1b634 271/468: Bump NEWS, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d4ee03e 278/468: Use syntax-propertize-function if it is available, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode fd0f6ba 280/468: Merge pull request #69 from atomontage/master, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 694421c 274/468: Add lua-remove-syntax-table-property to syntactic keywords, Philip Kaludercic, 2021/08/05