Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Preserving text editor caret position
Preserving text editor caret position [message #202600] Thu, 18 October 2007 12:25
Martin Vlk is currently offline Martin VlkFriend
Messages: 55
Registered: July 2009
Member
Hi All,
I am writing some code that checks the document text when the user
starts typing in the editor. If certain condition is satisfied it makes
some modifications to the document and stops checking.

The problem I get is that after the programmatic modification is
finished the caret is left at position different from where the user
started typing. The caret stays at the same line number, but the text
has been rolled down.

What would be the way to somehow remember the caret position so that
after the programmatic modifications are done the caret stays at the
same "logical" position. "Logical" meaning that when a new line is added
before the caret position the caret is moved down to stay at the same
line of text, rather than keeping the line number which of course
contains a different text after the modification.

Ideas appreciated.
Cheers
Martin
Previous Topic:How to: Convert a org.apache.xerces.dom Node to org.eclipse.wst.html.core.internal.document Node
Next Topic:.properties not loaded from WEB-INF/classes
Goto Forum:
  


Current Time: Fri Apr 26 17:21:27 GMT 2024

Powered by FUDForum. Page generated in 0.03096 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top