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 118659 - Provide a way to adjust caret position for IndentTask
Summary: Provide a way to adjust caret position for IndentTask
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Miloslav Metelka
URL:
Keywords: API
Depends on:
Blocks: 118616
  Show dependency tree
 
Reported: 2007-10-12 08:02 UTC by Tomasz Slota
Modified: 2007-11-05 13:39 UTC (History)
1 user (show)

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 Tomasz Slota 2007-10-12 08:02:30 UTC
It must be possible to adjust caret position from within IndentTask. Currently caret positioning is performed by the infrastructure and there is no way to 
influence it.
Comment 1 Vitezslav Stejskal 2007-10-12 10:13:42 UTC
Could you please describe your usecases?
Comment 2 Tomasz Slota 2007-10-12 10:38:20 UTC
I sometimes need to insert some extra whitespaces/new line characters in the IndentTask and then place the caret in a certain position between them. Now 
whenever I insert spaces to the document (before or after caret pos) the caret will be positioned at the end. Refer to issue 118616 for a specific example, 
please give me a call if additional explanation is needed.
Comment 3 Tomasz Slota 2007-10-12 10:50:07 UTC
for example to to implement the "smart enter" functionality (issue 118616), which looks like this:

<tag>|</tag>

->

<tag>
   |
</tag>

I need to:

 - detect situation when enter was pressed while caret was directly between opening and closing tag
 - insert extra new line character
 - *position the caret just before the extra new line character*
 - call formatter for the three lines centered in the line where the caret will positioned
Comment 4 Tomasz Slota 2007-10-12 14:07:58 UTC
This is a P2 since it is blocking 2 high priority indentation issues.
Comment 5 Petr Hrebejk 2007-10-12 17:32:10 UTC
Interestingly this blocks P3 issues.
Comment 6 Miloslav Metelka 2007-10-24 00:41:56 UTC
Should already be fixed by issue 116022.