emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/scala-mode aebc5b0 017/217: Fixes #7: indenting of block l


From: ELPA Syncer
Subject: [nongnu] elpa/scala-mode aebc5b0 017/217: Fixes #7: indenting of block lines when at last char of buffer
Date: Sun, 29 Aug 2021 11:30:35 -0400 (EDT)

branch: elpa/scala-mode
commit aebc5b0af95f3bfd9e76cb50b3cfd98b6fa50062
Author: Heikki Vesalainen <heikkivesalainen@yahoo.com>
Commit: Heikki Vesalainen <heikkivesalainen@yahoo.com>

    Fixes #7: indenting of block lines when at last char of buffer
---
 scala-mode-indent.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scala-mode-indent.el b/scala-mode-indent.el
index b766547..8e617c1 100644
--- a/scala-mode-indent.el
+++ b/scala-mode-indent.el
@@ -427,7 +427,7 @@ symbol, or nil if not."
         (point)))))
 
 (defun scala-indent:resolve-body-step (start &optional anchor)
-  (if (= (char-after start) ?\{)
+  (if (and (not (= start (point-max))) (= (char-after start) ?\{))
       0
     scala-indent:step))
 
@@ -473,7 +473,9 @@ anchor for calculating block indent for current point (or 
point
                        (goto-char anchor)
                        (scala-syntax:has-char-before ?= block-beg))))
                  scala-indent:step 0)))
-    (cond 
+    (cond
+     ;; at end of buffer
+     ((= start (point-max)) (+ scala-indent:step lead))
      ;; block close parentheses line up with anchor in normal case
      ((= (char-syntax (char-after start)) ?\))
       (+ 0 lead)) 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]