Skip to content

Bug in Ruby Syntax Highlighting for symbols #9918

@rovf

Description

@rovf

Description of the Issue

Steps to Reproduce the Issue

I have the following Ruby function definition:

def foo(s=%s.'".)
   p s
end

It defines a function foo, which accepts one optional argument s. If the caller does not specify a parameter, a default value is used. The default value is of Ruby type Symbol, and it is a symbol consiting of two characters: A single quote an a double quote. Hence, if this function would be invoked by

 foo

Ruby would print

:"'\""

which is how Ruby formats this type of symbols when printing using p.

Expected Behavior

I would expect that the Ruby syntax highlighter shows %s.'". in the colour of a symbol, and the following closing parenthese in the colour it uses for parentheses.

Actual Behavior

The syntax highlighter gets out of step when seeing the single quote, and seems to believe that this is the start of a string. It colours the remaining code as if it were a string.

Debug Information

Notepad++ v7.7.1 (64-bit)
Build time : Jun 16 2019 - 21:24:47
Path : C:\p\nppp64bit\notepad++.exe
Admin mode : OFF
Local Conf mode : ON
OS : Windows 10 (64-bit)
Plugins : AnalysePlugin.dll AutoEolFormat.dll Comment Wrap.dll ComparePlugin.dll CustomLineNumbers.dll MenuIcons.dll mimeTools.dll NppConverter.dll NppFavorites.dll NppXmlTreeviewPlugin.dll SelectQuotedText.dll SurroundSelection.dll XBrackets.dll _CustomizeToolbar.dll
capture_20210528_102330

Metadata

Metadata

Assignees

No one assigned

    Labels

    lexilla dependentCan't be considered for N++ implementation unless/until Lexiilla changesscintilla dependentCan't be considered for N++ implementation unless/until Scintilla changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions