summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/progmodes/ruby-mode.el1
-rw-r--r--test/indent/ruby.rb4
3 files changed, 9 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a0651917f3f..9a424b239c2 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2013-12-17 Dmitry Gutov <dgutov@yandex.ru>
+
+ * progmodes/ruby-mode.el (ruby-smie-rules): Indent ternary if.
+
2013-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
* net/shr.el (shr-insert-document): Remove unused var
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index e5148d29a97..54eba5b9164 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -577,6 +577,7 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'."
"+=" "-=" "*=" "/=" "%=" "**=" "&=" "|=" "^=" "|"
"<<=" ">>=" "&&=" "||=" "and" "or"))
(if (smie-rule-parent-p ";" nil) ruby-indent-level))
+ (`(:after . ,(or "?" ":")) ruby-indent-level)
(`(:before . "begin")
(unless (save-excursion (skip-chars-backward " \t") (bolp))
(smie-rule-parent)))
diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb
index 19bc0d03d47..c132b01fd86 100644
--- a/test/indent/ruby.rb
+++ b/test/indent/ruby.rb
@@ -330,3 +330,7 @@ end
%^abc^
ddd
+
+qux = foo ?
+ bar :
+ tee