Skip to content

Commit 1c88751

Browse files
committed
fix: flip tabs should be added after the pinned tabs
1 parent 360544c commit 1c88751

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/view/Pane.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,9 +908,17 @@ define(function (require, exports, module) {
908908
* @param {Object=} inPlace record with inPlace add data (index, indexRequested). Used internally
909909
*/
910910
Pane.prototype._addToViewList = function (file, inPlace) {
911-
if (inPlace && inPlace.indexRequested) {
911+
if (inPlace && inPlace.indexRequested && inPlace.index !== undefined) {
912912
// If specified, insert into the workingset at this 0-based index
913913
this._viewList.splice(inPlace.index, 0, file);
914+
} else if (inPlace && inPlace.indexRequested) {
915+
// Index requested but not specified (e.g., flip between panes) - insert after pinned files
916+
let insertIndex = 0;
917+
while (insertIndex < this._viewList.length &&
918+
this._pinnedPaths.has(this._viewList[insertIndex].fullPath)) {
919+
insertIndex++;
920+
}
921+
this._viewList.splice(insertIndex, 0, file);
914922
} else {
915923
// If no index is specified, just add the file to the end of the workingset.
916924
this._viewList.push(file);

0 commit comments

Comments
 (0)