How to programmatically implement a contrasting UI style similar to code diff in ide?

Answered

Just like the effect of the above picture, I hope to be able to achieve this effect through programming in the ide editor. Is there any relevant source code in the SDK for reference?

0
1 comment

I haven't tested it but Editor.getMarkupModel().addRangeHighlighter() might be what you are looking for.

Can get editor object with

Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor();
0

Please sign in to leave a comment.