summaryrefslogtreecommitdiff
path: root/test/lisp/progmodes/ruby-mode-resources/ruby-after-operator-indent.rb
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2022-12-30 23:58:26 +0200
committerDmitry Gutov <dgutov@yandex.ru>2022-12-31 00:00:21 +0200
commit8675f4136c7da7356e5578cf1eabda2f37a597e5 (patch)
treef37bbb61f80912e30f2428c20b16c30c8e7ab2bc /test/lisp/progmodes/ruby-mode-resources/ruby-after-operator-indent.rb
parent4922de626f05f0c26bc732b082c30c5c18a88416 (diff)
downloademacs-8675f4136c7da7356e5578cf1eabda2f37a597e5.tar.gz
emacs-8675f4136c7da7356e5578cf1eabda2f37a597e5.tar.bz2
emacs-8675f4136c7da7356e5578cf1eabda2f37a597e5.zip
Add new options for Ruby code indentation
* lisp/progmodes/ruby-mode.el (ruby-block-indent) (ruby-after-operator-indent, ruby-method-call-indent) (ruby-parenless-call-arguments-indent): New options (bug#60186). (ruby-smie-grammar): Specify associativity for "?". (ruby-smie--indent-to-stmt): Add optional argument. * test/lisp/progmodes/ruby-mode-resources/ruby.rb: New cases. * test/lisp/progmodes/ruby-mode-resources/ruby-method-call-indent.rb: * test/lisp/progmodes/ruby-mode-resources/ruby-block-indent.rb: * test/lisp/progmodes/ruby-mode-resources/ruby-after-operator-indent.rb: * test/lisp/progmodes/ruby-mode-resources/ ruby-parenless-call-arguments-indent.rb: New files. * test/lisp/progmodes/ruby-mode-tests.el: Add indentation tests for new files.
Diffstat (limited to 'test/lisp/progmodes/ruby-mode-resources/ruby-after-operator-indent.rb')
-rw-r--r--test/lisp/progmodes/ruby-mode-resources/ruby-after-operator-indent.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/lisp/progmodes/ruby-mode-resources/ruby-after-operator-indent.rb b/test/lisp/progmodes/ruby-mode-resources/ruby-after-operator-indent.rb
new file mode 100644
index 00000000000..25cd8736f97
--- /dev/null
+++ b/test/lisp/progmodes/ruby-mode-resources/ruby-after-operator-indent.rb
@@ -0,0 +1,29 @@
+4 +
+ 5 +
+ 6 +
+ 7
+
+qux = 4 + 5 *
+ 6 +
+ 7
+
+foo = obj.bar { |m| tee(m) } +
+ obj.qux { |m| hum(m) }
+
+foo.
+ bar
+ .baz
+
+qux = foo.fee ?
+ bar :
+ tee
+
+# Endless methods.
+class Bar
+ def foo(abc) = bar +
+ baz
+end
+
+# Local Variables:
+# ruby-after-operator-indent: nil
+# End: