branch: elpa/scala-mode
commit 25273762aca7f665db7688d9a1db1f872b69ad76
Merge: fe5c2c4 3f724ed
Author: Heikki Vesalainen <heikkivesalai...@yahoo.com>
Commit: Heikki Vesalainen <heikkivesalai...@yahoo.com>

    Merge pull request #12 from non/topic/optional-padding
    
    Add the scala-indent:pad-equals setting.
---
 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

Reply via email to