How to create temporary (red-framed) ranges in text editor

this feature is available for example in the xml editor after code completion. Several ranges in the newly created element are framed with a red line, and navigation in the editor is somehow constrained by these ranges.
Does anyone know how to produce these special ranges?

3 comments
Comment actions Permalink

Hello Dan,

this feature is available for example in the xml editor after code
completion. Several ranges in the newly created element are framed
with a red line, and navigation in the editor is somehow constrained
by these ranges.

Does anyone know how to produce these special ranges?


Editor.getMarkupModel().addRangeHighlighter() with TextAttributes.effectType
= EFFECT_BORDER

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Great! Thanks!

0
Comment actions Permalink

Dmitry Jemerov wrote:

Hello Dan,

>> this feature is available for example in the xml editor after code
>> completion. Several ranges in the newly created element are framed
>> with a red line, and navigation in the editor is somehow constrained
>> by these ranges.
>>
>> Does anyone know how to produce these special ranges?


Editor.getMarkupModel().addRangeHighlighter() with
TextAttributes.effectType = EFFECT_BORDER

From what I remember when I coded up the SyncEdit plugin, this only
provides the graphical behaviour. I had to override the existing cursor
movement actions to implement the constraints you mention.
Of course there may be a better way to implement these constraints...

N.

0

Please sign in to leave a comment.