+2013-10-26 Dmitry Gutov <dgutov@yandex.ru>
+
+ * progmodes/ruby-mode.el (ruby-smie--args-separator-p): Be more
+ specific in what the first arg can be: a non-keyword word,
+ string/regexp/percent literal opener, opening paren, or unary
+ operator followed directly by word.
+
2013-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
* progmodes/prolog.el: Remove old indent; use post-self-insert-hook.
(and
(< pos (line-end-position))
(or (eq (char-syntax (preceding-char)) '?w)
+ ;; FIXME: Check that the preceding token is not a keyword.
+ ;; This isn't very important most of the time, though.
(and (memq (preceding-char) '(?! ??))
(eq (char-syntax (char-before (1- (point)))) '?w)))
- (memq (char-syntax (char-after pos)) '(?w ?\"))))
+ (or (and (eq (char-syntax (char-after pos)) ?w)
+ (not (looking-at (regexp-opt '("unless" "if" "while" "until"
+ "else" "elsif" "do" "end")
+ 'symbols))))
+ (memq (syntax-after pos) '(7 15))
+ (save-excursion
+ (goto-char pos)
+ (looking-at "\\s(\\|[-+!~:]\\sw")))))
(defun ruby-smie--at-dot-call ()
(and (eq ?w (char-syntax (following-char)))
+2013-10-26 Dmitry Gutov <dgutov@yandex.ru>
+
+ * automated/ruby-mode-tests.el (ruby-toggle-block-to-brace): Fix
+ the test, in respect to adding the space after the curly.
+
2013-10-24 Michael Albinus <michael.albinus@gmx.de>
* automated/ert-tests.el (ert-test-skip-unless): New test case.
(should (string= "foo do |b|\nend" (buffer-string)))))
(ert-deftest ruby-toggle-block-to-brace ()
- (let ((pairs '((16 . "foo {|b| b + 2 }")
- (15 . "foo {|b|\n b + 2\n}"))))
+ (let ((pairs '((17 . "foo { |b| b + 2 }")
+ (16 . "foo { |b|\n b + 2\n}"))))
(dolist (pair pairs)
(with-temp-buffer
(let ((fill-column (car pair)))
method! arg1,
arg2
+method !arg1,
+ arg2
+
+method [],
+ arg2
+
+method :foo,
+ :bar
+
+method (a + b),
+ c, :d => :e,
+ f: g
+
it "is a method call with block" do |asd|
foo
end
i + 1
end
-method !arg1,
- arg2
-
-method [],
- arg2
-
-method :foo,
- :bar
-
-method (a + b),
- c
-
bar.foo do # "." is parent to "do"; it shouldn't be.
bar
end