This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 97629 - Cursor at the end of file after reformatting
Summary: Cursor at the end of file after reformatting
Status: RESOLVED FIXED
Alias: None
Product: ruby
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Torbjorn Norbye
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-11 17:33 UTC by Martin Krauskopf
Modified: 2007-07-03 14:43 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Krauskopf 2007-03-11 17:33:43 UTC
After pressing C-S-f (Reformat Code) the curses is always positioned at the end
of file. A little inconvenient.
Comment 1 Torbjorn Norbye 2007-03-14 00:09:06 UTC
I'm looking at the formatting API and I don't see a way to get my hands on the caret.

org.netbeans.editor.Formatter:    public int reformat(BaseDocument doc, int startOffset, int endOffset)

Perhaps I can do something horrible like looking for the associated FileObject (as a StreamProperty in the 
document), and from there fish out the DataObject, then the EditorCookie, then obtain the editor panes 
and get the caret. (Ewwww.)  

Since I believe the Format API will need to be redone for 6.0 anyway (to be lexer based rather than old-
style TokenID based) this can hopefully be accomodated more easily.
Comment 2 Torbjorn Norbye 2007-03-16 22:17:38 UTC
This is fixed
Comment 3 Jiri Kovalsky 2007-07-03 14:12:07 UTC
Reassigning this issue to newly created 'ruby' component.
Comment 4 Jiri Kovalsky 2007-07-03 14:43:02 UTC
Changing target milestone of all resolved Ruby issues from TBD to 6.0 Beta 1 build.