[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scala-mode d65f062 064/217: indent `while` like `if`, `for
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scala-mode d65f062 064/217: indent `while` like `if`, `for` et al (fixes #22) |
Date: |
Sun, 29 Aug 2021 11:30:44 -0400 (EDT) |
branch: elpa/scala-mode
commit d65f062afd163c226000f8100d554035c00d91ef
Author: Seth Tisue <seth@tisue.net>
Commit: Seth Tisue <seth@tisue.net>
indent `while` like `if`, `for` et al (fixes #22)
---
README.md | 15 +++++++++++++++
scala-mode-indent.el | 2 +-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index d6ae63a..863a7e8 100644
--- a/README.md
+++ b/README.md
@@ -318,6 +318,21 @@ customization variable *frame-background-mode* to *dark*
(use **M-x**
- highlights only properly formatted string and character constants
- indenting a code line removes trailing whitespace
+## Known issues
+
+*do/while* is not always handled correctly. For example:
+
+```scala
+do
+ foo
+while (bar)
+ foo
+```
+
+The indenter thinks the second occurrence of `foo` is the body of the while.
+To work around this, terminate the while with a semicolon,
+or put a blank line after it.
+
## Future work
- syntax-begin-function for reliably fontifying elements which span
diff --git a/scala-mode-indent.el b/scala-mode-indent.el
index cb5d6e4..4d4920e 100644
--- a/scala-mode-indent.el
+++ b/scala-mode-indent.el
@@ -506,7 +506,7 @@ point or nil if the point is not in a enumerator element >
1."
;;;
(defconst scala-indent:value-keyword-re
- (regexp-opt '("if" "else" "yield" "for" "try" "finally" "catch") 'words))
+ (regexp-opt '("if" "else" "while" "yield" "for" "try" "finally" "catch")
'words))
(defun scala-indent:body-p (&optional point)
"Returns the position of '=', 'if or 'else if' (TODO: or '=>')
- [nongnu] elpa/scala-mode b0c821d 023/217: Working on README, (continued)
- [nongnu] elpa/scala-mode b0c821d 023/217: Working on README, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 7faea31 027/217: also handle .sbt files, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 0930f14 026/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 2527376 032/217: Merge pull request #12 from non/topic/optional-padding, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 6aeb341 034/217: Edited README, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode bd0cd1a 035/217: Examples.md contains discussion on indenting, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 35f3eef 036/217: Fixes #10, if body in parameter lists, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode da67179 050/217: Merge pull request #15 from non/bug/fix-annotations, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 95e3742 063/217: fix typo in readme, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode ecb0d57 055/217: correct emacs version in check, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode d65f062 064/217: indent `while` like `if`, `for` et al (fixes #22),
ELPA Syncer <=
- [nongnu] elpa/scala-mode 280bff9 037/217: fix hex literal highlighting, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 3149a3d 049/217: Merge pull request #16 from gpampara/readme-update, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode aad6559 041/217: scala-indent:align-forms: obey scala-indent:indent-value-expression, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 94f34b2 077/217: Rm trailing whitespace from all project files., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 5d2416f 088/217: Reverted unintended removal of whitespace deletion hook, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 56280a2 062/217: Made scala-indent:indent-on-scaladoc-asterisk be an integral part of the mode., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode caaebbd 078/217: Rm unneccessary `integerp` invocation., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode b251627 079/217: Comment out example binding of `scala-indent:insert-asterisk-on-multiline-comment`, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode f4b5a6b 095/217: Add .sbt to config, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 037d202 090/217: Merge pull request #44 from vn971/patch-1, ELPA Syncer, 2021/08/29