Search code examples
rubyfoldinggeanycode-folding

How to fix incorrect folding of Ruby for Geany


Some Ruby code won't fold correctly in Geany.

For example, if I have

def validate(arr)
  if arr.any?(&:empty?)
    fail
  end
end

validate(["a", "b", "c"])
validate([""])

then folding the if folds too much:

First screenshot Second screenshot

Whereas if I use quotation marks around the text and question mark of the Ruby symbol (that is, change :empty? into :"empty?", then it folds correctly:

Third screenshot Fourth screenshot

How can I make Geany fold the code correctly, without having to change :empty? into :"empty?"? Is this a configuration thing, or a bug?


Solution

  • Current consensus, based on the comments, is that it's just a bug in Geany.

    I've created a bug report at https://bugs.launchpad.net/ubuntu/+source/geany/+bug/1337015