[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode 6a30c39 447/468: lua-is-continuing-statement-p: s
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode 6a30c39 447/468: lua-is-continuing-statement-p: short-circuit to false for "breaker" kws |
Date: |
Thu, 5 Aug 2021 04:59:26 -0400 (EDT) |
branch: elpa/lua-mode
commit 6a30c39a0bc1217f1678122b9aa112e620782d80
Author: immerrr <immerrr+lua@gmail.com>
Commit: immerrr <immerrr+lua@gmail.com>
lua-is-continuing-statement-p: short-circuit to false for "breaker" kws
---
lua-mode.el | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/lua-mode.el b/lua-mode.el
index 9bdf532..48598e1 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -1391,6 +1391,16 @@ previous one even though it looked like an
end-of-statement.")
(if (eql start-pos end-pos) start-pos (match-beginning 0))
(if (eql start-pos end-pos) start-pos (match-end 0))))))))
+(defun lua--continuation-breaking-line-p ()
+ "Return non-nil if looking at token(-s) that forbid continued line."
+ (save-excursion
+ (lua-skip-ws-and-comments-forward (line-end-position))
+ (looking-at (lua-rx (or (symbol "do" "while" "repeat" "until"
+ "if" "then" "elseif" "else"
+ "for" "local")
+ lua-funcheader)))))
+
+
(defun lua-is-continuing-statement-p-1 ()
"Return non-nil if current lined continues a statement.
@@ -1404,6 +1414,7 @@ The criteria for a continuing statement are:
(let (prev-line continuation-pos parent-block-opener)
(save-excursion (setq prev-line (lua-forward-line-skip-blanks 'back)))
(and prev-line
+ (not (lua--continuation-breaking-line-p))
(or
;; Binary operator or keyword that implies continuation.
(save-excursion
- [nongnu] elpa/lua-mode 6511687 323/468: Merge pull request #116 from immerrr/fix-derived-mode-p, (continued)
- [nongnu] elpa/lua-mode 6511687 323/468: Merge pull request #116 from immerrr/fix-derived-mode-p, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 563ac50 325/468: Merge pull request #115 from RobertCochran/escape-tabs, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 3019e75 327/468: Merge pull request #117 from immerrr/fix-string-parsing, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode a0d6744 331/468: travis.yml: add Emacs-25.1, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode dccda19 336/468: Wrap lua--fill-paragraph in save-excursion, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 7a97e1b 341/468: correct spelling mistake, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 0715340 337/468: Merge pull request #131 from jorams/fill-paragraph-save-excursion, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d759699 335/468: Merge pull request #129 from immerrr/fix-global-variable-in-lua-interpreter, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 459e3b7 427/468: Fix FIXME: `lua-prefix-key' is always `boundp', Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b793852 434/468: Add regression test, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6a30c39 447/468: lua-is-continuing-statement-p: short-circuit to false for "breaker" kws,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode b043ca4 451/468: lua-is-continuing-statement-p-1: fix missing save-excursion on branch, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6a837f7 458/468: with-lua-buffer: ensure font-lock is activated, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 08d83fc 443/468: Merge pull request #180 from nbfalcon/bugfix/lua-start-process-hangs, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 56af490 446/468: lua-find-regexp: escape string/comment after a match is ignored, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 93da584 449/468: Bump indentation tests, add missing function-call-arguments suite, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 0018e95 452/468: make-indentation-pair: don't calculate full indentation on every closer, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d2ff304 456/468: Copy cl-signum into lua--signum for backward compat, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 3688bf7 347/468: Merge pull request #136 from EdwardBetts/spelling, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6c69183 351/468: Merge pull request #139 from rrthomas/master, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode eacf137 349/468: Spell “Lua” consistently and its “process” (not “subprocess”), Philip Kaludercic, 2021/08/05