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.
The EditorCaret should allow working with Position.Bias in a way that DefaultCaret does i.e. the CaretInfo should have public Position.Bias getDotBias() {...} public Position.Bias getMarkBias() {...} and there should be a way to pass the bias to dot/mark modification methods.
Created attachment 159513 [details] Diff of proposed Caret API changes
Asking for API review. The proposed change adds bias to both dot and mark positions in CaretInfo and to methods where dot and mark positions are passed. Note: the bias accompanies positions in the proposed change but it's stored and handled separately from the position objects themselves i.e. the support for backward-bias positions creation in NbDocument.createPosition() is not used because backward-bias positions cause problems when intermixed with regular positions so their use should be abandoned in the longterm.
(In reply to Miloslav Metelka from comment #2) > Asking for API review. > The proposed change adds bias to both dot and mark positions in CaretInfo > and to methods where dot and mark positions are passed. > > Note: the bias accompanies positions in the proposed change but it's stored > and handled separately from the position objects themselves i.e. the support > for backward-bias positions creation in NbDocument.createPosition() is not > used because backward-bias positions cause problems when intermixed with > regular positions so their use should be abandoned in the longterm. Api looks fine to me. R1 - Would be good to add the info about backward-bias positions to the javadoc.
http://hg.netbeans.org/jet-main/rev/db067f40b14d
Unfortunately the change is incomplete since CaretMoveContext.setDot() CaretMoveContext.moveDot() CaretMoveContext.setDotAndMark() should be enhanced with bias parameter too.
http://hg.netbeans.org/jet-main/rev/0cd1b5f12f51
Integrated into 'main-silver', will be available in build *201609010002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/0cd1b5f12f51 User: Miloslav Metelka <mmetelka@netbeans.org> Log: #259023 - Extend EditorCaret by Position.Bias support - additional fix of CaretMoveContext methods.