]> git.eshelyaron.com Git - emacs.git/commit
ruby-ts-mode: Fix indent after operator or conditional
authorDmitry Gutov <dgutov@yandex.ru>
Wed, 18 Jan 2023 00:40:00 +0000 (02:40 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Wed, 18 Jan 2023 01:27:37 +0000 (03:27 +0200)
commit300ca6ac37250711b7d6484e0a870bf37e9e00cb
tree91ed050a3001d5d3b6ee57dec5fe7fb0cc0db5ec
parentac5516bd7d568bbcea4fe46273d4f44c891a71ae
ruby-ts-mode: Fix indent after operator or conditional

Make it match ruby-mode's indentation behavior.

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--binary-indent-anchor):
New function.
(ruby-ts--indent-rules): Use it instead of a composite matcher.
Add a rule for 'conditional'.
(ruby-ts--assignment-ancestor, ruby-ts--is-in-condition)
(ruby-ts--endless-method): Remove.

* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb:
Add examples.
lisp/progmodes/ruby-ts-mode.el
test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb