Skip to content

Syntax highlighter does not properly support Ruby percent strings #4964

@HertzDevil

Description

@HertzDevil

Description of the Issue

Certain Ruby string literals beginning with % do not apply or suppress syntax highlighting inside the string contents properly.

Steps to Reproduce the Issue

On any file with Ruby syntax highlighting enabled, enter the following:

%{abc def #{1} ghi}
%i{abc def #{1} ghi}
%q{abc def #{1} ghi}
%r{abc def #{1} ghi}
%s{abc def #{1} ghi}
%w{abc def #{1} ghi}
%x{abc def #{1} ghi}
%I{abc def #{1} ghi}
%Q{abc def #{1} ghi}
%W{abc def #{1} ghi}

Expected Behavior

  • %, %q, and %Q should be highlighted as strings, %r as regular expressions, %s as symbols, and %x as backticks.
  • String interpolation should be disabled in only %i, %q, %s, and %w.

Actual Behavior

  • These literals are not supported at all: %i, %s, %I. String interpolation is treated as comments, and def is treated as a keyword.
  • %w does not suppress string interpolation.
  • % and %Q do not display themselves like interpolated strings. %r and %x do not apply the correct colors.

Debug Information

Notepad++ v7.5.8 (32-bit)
Build time : Jul 23 2018 - 02:03:53
Path : C:\Program Files (x86)\Notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : OFF
OS : Windows 10 (64-bit)
Plugins : MarkdownViewerPlusPlus.dll NppEditorConfig.dll NppFTP.dll NPPJSONViewer.dll PluginManager.dll zoomdisabler.dll mimeTools.dll NppConverter.dll NppExport.dll

Reference

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