File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -291,6 +291,7 @@ class CustomEditorExtensionOutline implements IOutline<CustomEditorOutlineEntry>
291291 getActionsContext : ( entry : CustomEditorOutlineEntry ) => {
292292 return { id : entry . id } ;
293293 } ,
294+ alwaysRevealActiveElement : true ,
294295 } ;
295296
296297 // Listen for outline data changes from the extension provider
Original file line number Diff line number Diff line change @@ -348,7 +348,7 @@ export class OutlinePane extends ViewPane implements IOutlinePane {
348348 } ) ) ;
349349 // feature: reveal editor selection in outline
350350 const revealActiveElement = ( ) => {
351- if ( ! this . _outlineViewState . followCursor || ! newOutline . activeElement ) {
351+ if ( ! ( this . _outlineViewState . followCursor || newOutline . config . alwaysRevealActiveElement ) || ! newOutline . activeElement ) {
352352 return ;
353353 }
354354 let item = newOutline . activeElement ;
Original file line number Diff line number Diff line change @@ -76,6 +76,13 @@ export interface IOutlineListConfig<E> {
7676 readonly contextMenuId ?: MenuId ;
7777 readonly getContextKeyOverlay ?: ( element : E ) => [ string , ContextKeyValue ] [ ] ;
7878 readonly getActionsContext ?: ( element : E ) => unknown ;
79+ /**
80+ * When true, the outline pane always reveals the active element regardless
81+ * of the "follow cursor" setting. Useful for custom editors where the
82+ * extension explicitly sets the active item rather than deriving it from
83+ * cursor position.
84+ */
85+ readonly alwaysRevealActiveElement ?: boolean ;
7986}
8087
8188export interface OutlineChangeEvent {
You can’t perform that action at this time.
0 commit comments