[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools] Re: Difference between Cursor and Caret
|
There are two different kinds of text location, the selection and the carat.
The carat is always at one end or other of the selection; it indicates the
direction in which the selection was made or extended, which affects the
behavior of, e.g., Ctrl-Shift-left/right arrow.
To get the position of a change in an editor, however, you should set up a
document listener (implement IDocumentListener) and react to
documentChanged(). This gives you all the info you need to know about how
the document was affected.
Bob
"Syed" <sma_r@xxxxxxxxxxx> wrote in message
news:atsqb8$g03$1@xxxxxxxxxxxxxxxx
> Hi all,
> like to know what is the difference between a cursor and caret in regard
> to Editors especially Texteditor.I want to use the cursor/caret in the
> texteditor for me to know the exact position of it internally.
>
> I am trying to build an application where I need to insert text in a
> remote editor at the same location as was inserted in my editor.
>
> For example. I have two notepads open and whatever I type in editor 1
> should be typed also in editor 2 at the same location.I need to know how
> the cusor/caret get to know the number of positions it is suppose to move
> in side the editor.
>
> I hope this makes some sense.
>
> Thanks
> Syed
>