Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 257889 - Add support for positions inside tab characters or behind EOL
Add support for positions inside tab characters or behind EOL
Status: RESOLVED FIXED
Product: editor
Classification: Unclassified
Component: Painting & Printing
8.2
All All
: P3 (vote)
: 8.2
Assigned To: Miloslav Metelka
issues@editor
: API, API_REVIEW_FAST
Depends on:
Blocks: 200027 257893
  Show dependency treegraph
 
Reported: 2016-02-08 11:11 UTC by Ralph Ruijs
Modified: 2016-05-24 01:48 UTC (History)
4 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Ruijs 2016-02-08 11:11:33 UTC
To be able to paint, or add a caret inside a tab character or behind EOL, we need a new Position.
Comment 1 Ralph Ruijs 2016-02-08 11:16:49 UTC
Added ShiftPositions class to create and read ShiftPositions. The implementation ShiftPos is a position together with a shift of extra columns. This allows for positions behind line's last character (newline) or within a tab character.

Please review the class on the editor_multi_caret branch[1]. Thanks!


[1] - http://hg.netbeans.org/jet-main/file/391b2b3a41a2/editor.document/src/org/netbeans/api/editor/document/ShiftPositions.java
Comment 2 Miloslav Metelka 2016-02-18 10:42:34 UTC
The change is currently accompanied by adding an extended version of HighlightsSequence interface called ShiftHighlightsSequence that supports shifts within characters for highlights sequences too i.e. a caret related layer(s) may e.g. color individual spaces within tab characters.

http://hg.netbeans.org/jet-main/file/edb646598079/editor.lib2/src/org/netbeans/spi/editor/highlighting/ShiftHighlightsSequence.java

I'm still not 100% satisfied with 'ShiftPositions' name - would not e.g. 'CharShiftPositions' or 'CharSplitPositions' or 'SplitPositions' be better??
Comment 3 Miloslav Metelka 2016-02-18 10:44:37 UTC
We ask reviewers for fastrack review for these two classes. Thanks.
Comment 4 Vladimir Voskresensky 2016-02-18 12:12:51 UTC
(In reply to Miloslav Metelka from comment #2)

> I'm still not 100% satisfied with 'ShiftPositions' name - would not e.g.
> 'CharShiftPositions' or 'CharSplitPositions' or 'SplitPositions' be better??
How about RelativePositions?
Comment 5 Miloslav Metelka 2016-03-08 14:17:45 UTC
Thanks for the review.
Comment 6 Vladimir Voskresensky 2016-03-12 14:51:47 UTC
So, you decided to keep ShiftPositions?
Comment 7 Miloslav Metelka 2016-03-24 16:06:30 UTC
Vladimir, thanks for the RelativePositions.
Ralph came with ComplexPositions name which I sort of like even more because the complex numbers are also composed of two components just like (offset,shift) in our case.
Regarding ShiftPositions.getShift() the only better name that came to my mind so far was getSplitOffset() so in addition to Position.getOffset() there would be ComplexPositions.getSplitOffset() for getting an offset inside the splitted char.

If there are no objections I would prepare and commit the rename. I assume that it's not necessary to do any extra review since it's just a naming change and not a functional change.
Comment 8 Miloslav Metelka 2016-05-23 14:12:12 UTC
Integrated renaming of ShiftPositions to ComplexPositions
and ShiftHighlightsSequence to SplitOffsetHighlightsSequence.
Since there was no release with the original class names yet I treat the changes as compatible.

http://hg.netbeans.org/jet-main/rev/d051b114c772
Comment 9 Quality Engineering 2016-05-24 01:48:05 UTC
Integrated into 'main-silver', will be available in build *201605240002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/d051b114c772
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #257889 - Add support for positions inside tab characters or behind EOL - integrated renaming of ShiftPositions to ComplexPositions
and ShiftHighlightsSequence to SplitOffsetHighlightsSequence.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo