@@ -1244,6 +1244,14 @@ define(function (require, exports, module) {
12441244 $newItem . addClass ( provider ( data ) ) ;
12451245 } ) ;
12461246
1247+ // if the file is pinned, add the pin icon in the list item
1248+ const isPinned = MainViewManager . isPathPinned ( this . paneId , file . fullPath ) ;
1249+ if ( isPinned ) {
1250+ $newItem . addClass ( "pinned" ) ;
1251+ const $pinIcon = $ ( "<div class='pin-icon'><i class='fa-solid fa-thumbtack'></i></div>" ) ;
1252+ $newItem . append ( $pinIcon ) ;
1253+ }
1254+
12471255 // Update the listItem's apperance
12481256 this . _updateFileStatusIcon ( $newItem , _isOpenAndDirty ( file ) , false ) ;
12491257 _updateListItemSelection ( $newItem , selectedFile ) ;
@@ -1421,6 +1429,15 @@ define(function (require, exports, module) {
14211429 }
14221430 } ;
14231431
1432+ /**
1433+ * working set pin change (unpinned/pinned) event handler
1434+ */
1435+ WorkingSetView . prototype . _handleWorkingSetPinChange = function ( e , file , paneId ) {
1436+ if ( paneId === this . paneId ) {
1437+ this . _rebuildViewList ( true ) ;
1438+ }
1439+ } ;
1440+
14241441 /**
14251442 * dirtyFlagChange event handler
14261443 * @private
@@ -1469,6 +1486,8 @@ define(function (require, exports, module) {
14691486 MainViewManager . on ( this . _makeEventName ( "activePaneChange" ) , _ . bind ( this . _handleActivePaneChange , this ) ) ;
14701487 MainViewManager . on ( this . _makeEventName ( "paneLayoutChange" ) , _ . bind ( this . _handlePaneLayoutChange , this ) ) ;
14711488 MainViewManager . on ( this . _makeEventName ( "workingSetUpdate" ) , _ . bind ( this . _handleWorkingSetUpdate , this ) ) ;
1489+ MainViewManager . on ( this . _makeEventName ( "workingSetPinned" ) , _ . bind ( this . _handleWorkingSetPinChange , this ) ) ;
1490+ MainViewManager . on ( this . _makeEventName ( "workingSetUnpinned" ) , _ . bind ( this . _handleWorkingSetPinChange , this ) ) ;
14721491
14731492 DocumentManager . on ( this . _makeEventName ( "dirtyFlagChange" ) , _ . bind ( this . _handleDirtyFlagChanged , this ) ) ;
14741493
0 commit comments