From 261591467946bf440a74df442e0797873ae8ac42 Mon Sep 17 00:00:00 2001 From: Vinit Agrawal Date: Mon, 8 Feb 2016 04:53:49 +0530 Subject: [PATCH] opening new file will add the entry on the sidebar right next to current entry, instead of adding it at the last + moving the tab using will reorder the entries of opened file in the same order as the tabs --- lib/tree-view-open-files-pane-view.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/tree-view-open-files-pane-view.coffee b/lib/tree-view-open-files-pane-view.coffee index 39d0dda..237e38c 100644 --- a/lib/tree-view-open-files-pane-view.coffee +++ b/lib/tree-view-open-files-pane-view.coffee @@ -53,7 +53,7 @@ class TreeViewOpenFilesPaneView listItemName.setAttribute('data-path', item.getPath?()) listItemName.setAttribute('data-name', item.getTitle?()) listItem.appendChild listItemName - @container.appendChild listItem + @container.insertBefore(listItem, @activeEntry?.nextSibling); if item.onDidChangeTitle? titleSub = item.onDidChangeTitle => @updateTitle item @@ -72,6 +72,11 @@ class TreeViewOpenFilesPaneView @paneSub.add pane.onDidRemoveItem ({item}) => @removeEntry item + @paneSub.add pane.onDidMoveItem ({item, oldIndex, newIndex}) => + movedEntry = @entryForItem item + @container.removeChild(movedEntry.element) + @container.insertBefore(movedEntry.element, @container.children[newIndex]); + @paneSub.add pane.onDidDestroy => @paneSub.dispose() updateTitle: (item, siblings=true, useLongTitle=false) ->