Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex processing order, base style #641

Open
perholmes opened this issue Oct 17, 2024 · 1 comment
Open

Regex processing order, base style #641

perholmes opened this issue Oct 17, 2024 · 1 comment

Comments

@perholmes
Copy link

FEATURE REQUEST: Some kind of way to control the priority of highlighting rules, so that when a rule has been applied, no further rules are applied. Then the rules should be processed in the order they appear in the settings JSON. Rule collisions are common, and the order rules are applied in shouldn't be random. This feature would also allow users to create a base style.

BACKGROUND: I was trying to make a base style color, but it doesn't seem possible. I wanted the base text to be gray instead of white, but creating a regex that catches everything bypasses most of my other coloring rules, but not all.

It appears that RegExes are processed in some kind of deterministic, but not sequential order, either alphabetical order or current runtime memory order of a set or a map. If I make a rule catching [\s\S]* and place it at the top, certain rules are suppressed. If I place it at the end of the list, certain other rules are suppressed. I thus had to give up on making a base style, and tolerate the (very) white color of the default style.

@emilast
Copy link
Owner

emilast commented Oct 23, 2024

Thank you for your suggestion. I will consider possible improvements in this area.

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

No branches or pull requests

2 participants