[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scala-mode 3f724ed 030/217: Add the scala-indent:pad-equal
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scala-mode 3f724ed 030/217: Add the scala-indent:pad-equals setting. |
Date: |
Sun, 29 Aug 2021 11:30:38 -0400 (EDT) |
branch: elpa/scala-mode
commit 3f724ed1c9f5f5e6f6c07a3a39d0c8fd30f94fd8
Author: Erik Osheim <d_m@plastic-idolatry.com>
Commit: Erik Osheim <d_m@plastic-idolatry.com>
Add the scala-indent:pad-equals setting.
This setting (default t) controls whether you get extra indentation
in the cases where statements follow =. Here is an example:
// with scala-indent:pad-equals t
def foo(x: Int) = x match {
case _ => 999
}
// with scala-indent:pad-equals nil
def foo(x: Int) = x match {
case _ => 999
}
I've defaulted the setting to t to respect the old behavior, but I
strongly suspect that most users of the mode will probably want the
setting set to nil. We'll see I guess.
---
scala-mode-indent.el | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/scala-mode-indent.el b/scala-mode-indent.el
index b88d8c1..54fb86e 100644
--- a/scala-mode-indent.el
+++ b/scala-mode-indent.el
@@ -13,6 +13,11 @@ indentation will be one or two steps depending on context."
:type 'integer
:group 'scala)
+(defcustom scala-indent:pad-equals t
+ "Whether or not to indent an extral level directly after =."
+ :type 'boolean
+ :group 'scala)
+
(defconst scala-indent:eager-strategy 0
"See 'scala-indent:run-on-strategy'")
(defconst scala-indent:operator-strategy 1
@@ -464,14 +469,14 @@ anchor for calculating block indent for current point (or
point
"Resolves the appropriate indent step for block line at position
'start' relative to the block anchor 'anchor'."
(let
- ;; calculate a lead that is used for all steps. The lead is one
- ;; indent step if there is a '=' between anchor and start,
- ;; otherwise 0.
- ((lead (if (ignore-errors
+ ;;; calculate a lead that is used for all steps. The lead is one
+ ;;; indent step if there is a '=' between anchor and start,
+ ;;; otherwise 0.
+ ((lead (if (and scala-indent:pad-equals (ignore-errors
(save-excursion
(let ((block-beg (nth 1 (syntax-ppss start))))
(goto-char anchor)
- (scala-syntax:has-char-before ?= block-beg))))
+ (scala-syntax:has-char-before ?= block-beg)))))
scala-indent:step 0)))
(cond
;; at end of buffer
- [nongnu] elpa/scala-mode 0c5ed9e 022/217: deleted example files, (continued)
- [nongnu] elpa/scala-mode 0c5ed9e 022/217: deleted example files, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 61a511f 021/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode fe5c2c4 031/217: Fixes #11: was still using the slow regexp, not faster, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 1a3d958 029/217: forward/backward-sexp, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode e30b35a 008/217: Indentation working, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 59cdd94 074/217: Add `scala-indent:use-javadoc-style` defcustom., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 347faeb 075/217: Add Evan Meagher to contributors list., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 081a92b 081/217: scala-indent:remove-indent-from-previous-empty-line, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 0fac9ae 014/217: removed debug messages, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 9476d4c 018/217: Fixes #3: alignment of else inside parens, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 3f724ed 030/217: Add the scala-indent:pad-equals setting.,
ELPA Syncer <=
- [nongnu] elpa/scala-mode 6257e3b 033/217: Renamed bad-equals to indent-value-expression. Added info to README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 4e3a24f 043/217: Updated Examples.md to reflect issues already solved, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 338ff73 060/217: Changed the indent defaults, closes #19, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 6c257f6 057/217: Enhanced support for comments and multi-line strings, including, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 68ca175 056/217: Fixes #20, the cons bug (a :: b :: Nil) as well as improving some of, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 78fff40 039/217: scala-indent:align-forms customization variable, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode f61e32d 047/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 0991658 051/217: Fixes #17: string syntax, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 3174f4c 048/217: Update README.md clone to be a valid command., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode a78716d 046/217: Update README.md, ELPA Syncer, 2021/08/29