mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 11:15:24 +03:00
[language-ruby] Fix our attempt to fold Ruby comments…
…so that it doesn’t try to look up a child node that we know won’t exist. Most Ruby comments aren’t foldable because they start and end on the same line — by their very nature! But there is one obscure multi-line syntax that we can support, so this tells Pulsar to fold to the end of the comment itself.
This commit is contained in:
parent
b61e491f2e
commit
ef26c588a3
@ -1,6 +1,5 @@
|
|||||||
[
|
[
|
||||||
(method)
|
(method)
|
||||||
(comment)
|
|
||||||
(singleton_method)
|
(singleton_method)
|
||||||
(class)
|
(class)
|
||||||
(module)
|
(module)
|
||||||
@ -16,6 +15,10 @@
|
|||||||
(string_array)
|
(string_array)
|
||||||
] @fold
|
] @fold
|
||||||
|
|
||||||
|
; Multi-line comment syntax (=begin…=end) is obscure and out of favor, but we
|
||||||
|
; might as well make it foldable.
|
||||||
|
((comment) @fold
|
||||||
|
(#set! fold.endAt endPosition))
|
||||||
|
|
||||||
; Fold from `if` to the next `elsif` or `else` in the chain.
|
; Fold from `if` to the next `elsif` or `else` in the chain.
|
||||||
((if
|
((if
|
||||||
|
Loading…
Reference in New Issue
Block a user