Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#407 Broken Ruby syntax highlighting

v1.23
closed-fixed
Filetypes (68)
4
2012-10-25
2009-12-05
pro nihilo
No

Version: 0.18
OS: Windows 7 64
GTK+ version: Uh, failed to determine it according to the instructions on the Geany site. I ran "C:\Program Files (x86)\Geany\bin\geany.exe" -V which did nothing, I ran "C:\Program Files (x86)\Geany\bin\geany.exe" -v and it simply launched a new instance of Geany without printing any new information.

Geany appears to have problems with <<END style multiline strings in Ruby source code, see the screenshoted I attached in which it erroneously interprets a string as code as a result of this bug. Here is the code from the screenshot:

class FormWriter
def initialize(output, action)
@output = output
@output.concat "<form action=\"#{action}\" method=\"post\">\n"
end

def label(label, type = 'text', name = label.downcase, id = name)
passwordString = 'password'
type = passwordString if label.downcase.include? passwordString
@output.concat "<p>\n<label for=\"#{id}\">#{label}:</label><br />\n<input type=\"#{type}\" id=\"#{id}\" name=\"#{name}\" />\n</p>\n"
end

def submitButton
@output.concat <<END
<p>
<input type="submit" />
</p>
END
end

def endOfForm
@output.concat "</form>\n"
end

def finish
submitButton
endOfForm
end
end

Discussion

  • pro nihilo
    pro nihilo
    2009-12-05

    Screenshot of the erroneous syntax highlighting

     
    Attachments
  • pro nihilo
    pro nihilo
    2009-12-05

    Ruby source code used

     
    Attachments
  • pro nihilo
    pro nihilo
    2009-12-05

    • labels: 1084466 --> 790033
    • priority: 5 --> 4
     
  • Nick Treleaven
    Nick Treleaven
    2009-12-07

    Hi,
    BTW the version switch should be run from a command prompt - but gtk/glib version probably don't matter for this bug.

    Could you file a bug at scintilla.org - this is where we get the ruby lexer from (LexRuby.cxx). The bug seems to occur when the line with the <<END has an @ sign before the function call. If you could provide the following test case they could maybe fix it.

    def submitButton
    @output.concat <<END
    <p>
    <input type="submit" />
    </p>
    END
    def finish
    submitButton
    endOfForm
    end
    end

     
  • Lex Trotman
    Lex Trotman
    2012-09-14

    • assigned_to: nobody --> colombanw
     
    • status: open --> open-accepted
     
    • milestone: --> v1.23
    • labels: 790033 --> Filetypes
    • status: open-accepted --> closed-fixed
     
  • Now fixed in Git, thanks for reporting.