Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Escaped characters in Ruby regex throws off color syntax highlighter #295

Open
jreif opened this issue Mar 16, 2021 · 3 comments
Open

Escaped characters in Ruby regex throws off color syntax highlighter #295

jreif opened this issue Mar 16, 2021 · 3 comments

Comments

@jreif
Copy link

jreif commented Mar 16, 2021

Description

When writing code in ruby that includes an empty regex expression (ex: //) or that includes only an escaped character (ex: /\D/), it throws off the colors of the syntax highlighter on the line and often on the rest of the file too.

Steps to Reproduce

  1. Create new file
  2. Select Ruby grammar for the file
  3. Type the following line of code character by character: "test 123".match(/\D/)

Expected behavior:

Expectation is for colors to remain correct instead of blanking out. Ex: green for string, blue for method, purple for regex delimiters (forward slashes), light blue for escaped characters within regex.

Actual behavior:

Note colors look ok as you type, but colors go away as soon as you close the regex expression (second forward slash) and whole line remains in plain white color. There are some variations to this but this is the simplest example I can describe that consistently borks like this.

Reproduces how often:

All the time.

Versions

macOS 11.2.3
Atom : 1.55.0
Electron: 6.1.12
Chrome : 76.0.3809.146
Node : 12.4.0
apm 2.5.2
npm 6.14.8
node 12.4.0 x64
atom 1.55.0
python 2.7.16
git 2.30.1

@aminya
Copy link
Contributor

aminya commented Mar 22, 2021

You should open the issue with the example code in this repo:
https://github.com/atom/language-ruby

@darangi darangi transferred this issue from atom/atom Mar 23, 2021
@darangi
Copy link
Contributor

darangi commented Mar 23, 2021

@jreif Could you add some code samples? A screenshot or gif would be good

@jreif
Copy link
Author

jreif commented Mar 24, 2021

atom-highlight

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants