From 417eeecba650884191bdad8b1579b2555e05e796 Mon Sep 17 00:00:00 2001 From: schinz Date: Mon, 5 Jul 2004 14:31:57 +0000 Subject: - correctly highlight view bounds, - indent box comments better --- support/emacs/scala-mode.el | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'support/emacs') 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)))) -- cgit v1.2.3