mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-10 08:10:21 -08:00
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.
This commit is contained in:
parent
4922de626f
commit
8675f4136c
7 changed files with 251 additions and 17 deletions
|
|
@ -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:
|
||||
Loading…
Add table
Add a link
Reference in a new issue