Skip to content

Custom styling for specific ranges in editor #5789

Answered by nightwing
bajrangCoder asked this question in Q&A
Discussion options

You must be logged in to vote

editor.session.bgTokenizer.lines[row] has a list of objects like {type: 'paren.rparen', value: ')'} you need to find the one you want add a class to it, and call editor.renderer.updateLines

e.g. you can try on https://ace.c9.io/

editor.session.bgTokenizer.lines[7][8].type+=".invalid"
editor.renderer.updateLines(7,7)

but depending on how you get the ranges, and how you update them during editing, you may need to optimize performance and handle the case when several brackets are in the same token.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@bajrangCoder
Comment options

@nightwing
Comment options

Answer selected by bajrangCoder
@bajrangCoder
Comment options

@nightwing
Comment options

@bajrangCoder
Comment options

@nightwing
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants