@@ -123,26 +123,29 @@ define(function (require, exports, module) {
123123 return ;
124124 }
125125
126- // set up all the necessary properties
127- const activeEditor = EditorManager . getActiveEditor ( ) ;
128- const activePath = activeEditor ? activeEditor . document . file . fullPath : null ;
126+ // get the current active file for this specific pane
127+ const activeFileInPane = MainViewManager . getCurrentlyViewedFile ( paneId ) ;
128+ const activePathInPane = activeFileInPane ? activeFileInPane . fullPath : null ;
129129
130+ // Check if this file is active in its pane
131+ const isActive = ( entry . path === activePathInPane ) ;
132+
133+ // Current active pane (used to determine whether to add the blue underline)
130134 const currentActivePane = MainViewManager . getActivePaneId ( ) ;
131- // if the file is the currently active file
132- // also verify that the tab belongs to the active pane
133- const isActive = ( entry . path === activePath && paneId === currentActivePane ) ;
134- const isDirty = Helper . _isFileModified ( FileSystem . getFileForPath ( entry . path ) ) ; // if the file is dirty
135+ const isPaneActive = ( paneId === currentActivePane ) ;
136+
137+ const isDirty = Helper . _isFileModified ( FileSystem . getFileForPath ( entry . path ) ) ;
135138
136- // Create the tab element with the structure we need
137- // tab name is written as a separate div because it may include directory info which we style differently
139+ // create tab with active class
138140 const $tab = $ (
139- `<div class="tab ${ isActive ? 'active' : '' } ${ isDirty ? 'dirty' : '' } "
140- data-path="${ entry . path } "
141- title="${ entry . path } ">
142- <div class="tab-icon"></div>
143- <div class="tab-name"></div>
144- <div class="tab-close"><i class="fa-solid fa-times"></i></div>
145- </div>` ) ;
141+ `<div class="tab
142+ ${ isActive ? 'active' : '' }
143+ ${ isDirty ? 'dirty' : '' } " data-path="${ entry . path } " title="${ entry . path } ">
144+ <div class="tab-icon"></div>
145+ <div class="tab-name"></div>
146+ <div class="tab-close"><i class="fa-solid fa-times"></i></div>
147+ </div>`
148+ ) ;
146149
147150 // Add the file icon
148151 const $icon = Helper . _getFileIcon ( entry ) ;
@@ -163,6 +166,13 @@ define(function (require, exports, module) {
163166 $tabName . text ( entry . name ) ;
164167 }
165168
169+ // only add the underline class if this is both active AND in the active pane
170+ if ( isActive && ! isPaneActive ) {
171+ // if it's active but in a non-active pane, we add a special class
172+ // to style differently in CSS to indicate that it's active but not in the active pane
173+ $tab . addClass ( 'active-in-inactive-pane' ) ;
174+ }
175+
166176 return $tab ;
167177 }
168178
0 commit comments