Last active
June 28, 2018 20:59
-
-
Save CrossR/865df001c777a1eadf78c03997473bb0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function makeBookmarksMenu(oni: Oni.Plugin.Api) { | |
const bookmarkMenu = oni.menu.create() | |
let gitFolder = "F:\\User Files\\Documents\\Git" | |
const gitProjects = getDirectories(gitFolder) | |
let menuItems = gitProjects.map(b => ({ | |
icon: "bookmark", | |
detail: b, | |
label: b.split("\\").pop(), | |
})) | |
bookmarkMenu.show() | |
bookmarkMenu.setItems(menuItems) | |
bookmarkMenu.onItemSelected.subscribe(menuItem => { | |
if (menuItem) { | |
oni.workspace.changeDirectory(menuItem.detail) | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment