Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Editor Plugin problem when folding is enabled. (in M9)
Editor Plugin problem when folding is enabled. (in M9) [message #250004] Mon, 07 June 2004 07:16
Eclipse UserFriend
Originally posted by: mravi.web.de

Hi,

I have a editor plugin which is running into problems when folding is
enabled. If I disable folding, its working fine.

I'm trying to capture the keystore ARROW_DOWN to go to next line.

The code is as follows.

public int goToLine (int linenum) { /* I call this with linenum
(presentline no + 1) */
try {
// see that the line is in the document and get the line
IRegion line = thisdocument.getLineInformation(linenum);

int cursorPosition = getSelection().getOffset() -
getLine().getOffset();
if (line.getLength() < cursorPosition) {
cursorPosition = line.getLength();
}
mySelection = new TextSelection( myDocument,
cursorPosition , 0);
if ( myTextViewer != null) {

myTextViewer.getTextWidget().setCaretOffset(cursorPosition );
myTextViewer.getTextWidget().showSelection();
}
return getSelection().getOffset();
}
}
catch (LocationException e) {
return -1;
}
}

This code works fine when there are no hidden lines. But with folding,
not all the lines are visible. As a result, the cursor movement goes
haywire.

Any clues on how this has to be handled?

Rgds,
Ravi.
Previous Topic:Can I put Eclipse plugins into my features?
Next Topic:2 Plugin Instances?
Goto Forum:
  


Current Time: Sat Jul 13 23:43:39 GMT 2024

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

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

Back to the top