summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorschinz <schinz@epfl.ch>2004-07-05 14:31:57 +0000
committerschinz <schinz@epfl.ch>2004-07-05 14:31:57 +0000
commit417eeecba650884191bdad8b1579b2555e05e796 (patch)
tree78b79b00491d81f4e2c71c01bff0e21ade398051 /support
parent5325bdaaf253bbbed772563563db27b1add96ae1 (diff)
downloadscala-417eeecba650884191bdad8b1579b2555e05e796.tar.gz
scala-417eeecba650884191bdad8b1579b2555e05e796.tar.bz2
scala-417eeecba650884191bdad8b1579b2555e05e796.zip
- correctly highlight view bounds,
- indent box comments better
Diffstat (limited to 'support')
-rw-r--r--support/emacs/scala-mode.el16
1 files changed, 14 insertions, 2 deletions
diff --git a/support/emacs/scala-mode.el b/support/emacs/scala-mode.el
index e927b21253..74e412fde8 100644
--- a/support/emacs/scala-mode.el
+++ b/support/emacs/scala-mode.el
@@ -275,7 +275,7 @@ reserved keywords when used alone.")
(scala-when-looking-at "\\s *[-+]\\s *")
(scala-forward-ident)
;; bounds
- (while (scala-when-looking-at "\\s *[<>]:\\s *")
+ (while (scala-when-looking-at "\\s *[<>][:%]\\s *")
(scala-forward-type))
t)
@@ -313,11 +313,23 @@ reserved keywords when used alone.")
"Return the suggested indentation for the current line."
(save-excursion
(beginning-of-line)
- (or (scala-indentation-from-following)
+ (or (and (scala-in-comment-p)
+ (not (= (char-after) ?\/))
+ (scala-comment-indentation))
+ (scala-indentation-from-following)
(scala-indentation-from-preceding)
(scala-indentation-from-block)
0)))
+(defun scala-comment-indentation ()
+ ;; Return suggested indentation inside of a comment.
+ (forward-line -1)
+ (beginning-of-line)
+ (skip-syntax-forward " ")
+ (if (looking-at "/\\*")
+ (+ 1 (current-column))
+ (current-column)))
+
(defun scala-block-indentation ()
(let ((block-start-eol (scala-point-after (end-of-line)))
(block-after-spc (scala-point-after (scala-forward-spaces))))