#571 Block start/stop incorrectly identified in Ruby programs

Filetypes (68)
Bob Bevan-Jones

Geany version 0.18 "Kaine" on Ubuntu 10.04 (lucid)

See the attached file for an example Ruby program consisting of one class and three subroutines ("initialize", "run" and "terminate").

1. Load the example Ruby program into Geany.
2. Notice immediately how, in the Symbols window, the subroutines are not correctly lined up.
3. Collapse the second subroutine ("run") using the boxed minus sign on the left of the line reading "def run".
4. Notice how this collapses not just subroutine "run" but also subroutine "terminate" as well.
5. I have a much larger program consisting of several classes and dozens of subroutines in which this behaviour is amplified.


  • Lex Trotman
    Lex Trotman

    • status: open --> pending
  • Lex Trotman
    Lex Trotman

    No attachment provided, will close if none provided in a couple of weeks.

  • Example code for ID: 3094431

  • Recently retested with Geany 0.20 ("Disra") on Linux Mint running kernel 3.0.0-12-generic. Same outcome.

    • status: pending --> open
  • Lex Trotman
    Lex Trotman

    Bug still happens on Geany 1.23 (git >= c05f1bd).

  • Lex Trotman
    Lex Trotman

    • status: open --> open-accepted
  • OK, I see the problem. Weirdly not only the folding is buggy but the tags hierarchy is wrong too, seeing "terminate" as a child of "run"; although those two things are done by completely different means.

    Apparently both parsers get fooled by the "for x in [...] do": they open a scope on the "for" AND on the "do". Using the syntax "[...].each do |x|" don't fool the parsers though (and seems more standard as far as I can read the internets).

    • assigned_to: nobody --> colombanw
    • labels: 790033 -->
  • Now fixed in Git, thanks for reporting.

    • milestone: --> v1.23
    • labels: --> Filetypes
    • status: open-accepted --> closed-fixed