Skip to content
This repository was archived by the owner on Apr 1, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
641509f
pull upstream
akinsho Jun 5, 2018
8e8272a
Merge branch 'master' of https://github.com/onivim/oni
akinsho Jun 10, 2018
3efbd65
Merge branch 'master' of https://github.com/onivim/oni
akinsho Jun 19, 2018
4d90c11
Merge branch 'master' of https://github.com/onivim/oni
akinsho Jun 23, 2018
5f51367
Merge branch 'master' of https://github.com/onivim/oni
akinsho Jun 24, 2018
f9cce1f
Merge branch 'master' of https://github.com/onivim/oni
akinsho Jun 27, 2018
27e7269
Merge branch 'master' of https://github.com/onivim/oni
akinsho Jun 28, 2018
6c3adc2
Merge branch 'master' of https://github.com/onivim/oni
akinsho Jul 7, 2018
c83752d
Merge branch 'master' of https://github.com/onivim/oni
akinsho Jul 10, 2018
db81509
Merge branch 'master' of https://github.com/onivim/oni
akinsho Jul 11, 2018
5993875
Merge branch 'master' of https://github.com/onivim/oni
akinsho Jul 15, 2018
98dc861
Merge branch 'master' of https://github.com/onivim/oni
akinsho Jul 18, 2018
a89c5e9
Merge branch 'master' of https://github.com/onivim/oni
akinsho Jul 18, 2018
15ebafd
add initial WIP commiting functionality
akinsho Jul 18, 2018
6cd3014
rename version control branch, separate out vcsStatus update imports
akinsho Jul 19, 2018
7851f40
add prop to set a type of Input element for lightweight text
akinsho Jul 19, 2018
ea94fc6
remove unnecessary type annotations add format commit message function
akinsho Jul 19, 2018
667c1f1
move vcs components to subfolder
akinsho Jul 19, 2018
abd9c8e
remove message from commit interface
akinsho Jul 19, 2018
2815e1c
fix type issues
akinsho Jul 19, 2018
e16cc95
fix moar type issues
akinsho Jul 19, 2018
9bb010a
modularise version control test
akinsho Jul 19, 2018
ef330c9
add tests for vcs commits component
akinsho Jul 19, 2018
08ab3a7
add tests for new reducer branches
akinsho Jul 19, 2018
97bfb1e
set commits to closed by default
akinsho Jul 20, 2018
ff3a400
[WIP] add commit one and all functionality
akinsho Jul 20, 2018
bd0259b
prettier fix
akinsho Jul 20, 2018
a6768f2
separate out different subsection of pane and modularise
akinsho Jul 20, 2018
d795fe2
add new files for each section
akinsho Jul 20, 2018
896ec0b
add keys to staged, improve error notifications
akinsho Jul 20, 2018
417b2f2
fix refresh binding
akinsho Jul 20, 2018
5b6fb20
add help and toggle help commands
akinsho Jul 20, 2018
1859b8a
add commit fail action and handler
akinsho Jul 20, 2018
2213d25
update one test comment out failing one (needs to be refactored)
akinsho Jul 20, 2018
60b0b05
prettier fix
akinsho Jul 20, 2018
242f53f
update test to pass in sidebar
akinsho Jul 20, 2018
86d6d18
pass down sidebar to vcs pane
akinsho Jul 20, 2018
060b0f6
Pass down sidebar and render loading per item
akinsho Jul 20, 2018
2bd256e
call getStatus after commiting
akinsho Jul 20, 2018
be35212
add loading handler
akinsho Jul 20, 2018
c2fcdb4
add key to loading handler
akinsho Jul 20, 2018
51e4f4b
update tests for vcsview
akinsho Jul 20, 2018
b3ca25c
fix package json typo
akinsho Jul 20, 2018
54fdcb4
fix lint error
akinsho Jul 20, 2018
e0aa2a5
merge upstream fix conflicts
akinsho Jul 20, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions browser/src/Input/KeyBindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@ export const applyDefaultKeyBindings = (oni: Oni.Plugin.Api, config: Configurati
editors.activeEditor.mode === "insert" || editors.activeEditor.mode === "cmdline_normal"

const oniWithSidebar = oni as Oni.Plugin.Api & ISidebar
const isExplorerActive = () =>
oniWithSidebar.sidebar.activeEntryId === "oni.sidebar.explorer" &&
const isSidebarPaneOpen = (paneId: string) =>
oniWithSidebar.sidebar.activeEntryId === paneId &&
oniWithSidebar.sidebar.isFocused &&
!isInsertOrCommandMode() &&
!isMenuOpen()

const isExplorerActive = () => isSidebarPaneOpen("oni.sidebar.explorer")
const isVCSActive = () => isSidebarPaneOpen("oni.sidebar.vcs")

const isMenuOpen = () => menu.isMenuOpen()

if (Platform.isMac()) {
Expand Down Expand Up @@ -159,4 +162,9 @@ export const applyDefaultKeyBindings = (oni: Oni.Plugin.Api, config: Configurati
input.bind("j", "browser.scrollDown")
input.bind("h", "browser.scrollLeft")
input.bind("l", "browser.scrollRight")

// VCS
input.bind("e", "vcs.openFile", isVCSActive)
input.bind("<c-r>", "vcs.refresh", isVCSActive)
input.bind("?", "vcs.showHelp", isVCSActive)
}
4 changes: 4 additions & 0 deletions browser/src/Services/Sidebar/SidebarStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ export class SidebarManager {
return this._contentSplit.isFocused
}

get isVisible(): boolean {
return this._contentSplit.isVisible
}

public get store(): Store<ISidebarState> {
return this._store
}
Expand Down
30 changes: 23 additions & 7 deletions browser/src/Services/VersionControl/VersionControlManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as React from "react"

import { store, SupportedProviders, VersionControlPane, VersionControlProvider } from "./"
import { Notifications } from "./../../Services/Notifications"
import { Branch } from "./../../UI/components/VersionControl"
import { Branch } from "./../../UI/components/VersionControl/Branch"
import { MenuManager } from "./../Menu"
import { SidebarManager } from "./../Sidebar"
import { IWorkspace } from "./../Workspace"
Expand All @@ -15,6 +15,7 @@ interface ISendNotificationsArgs {
detail: string
level: "info" | "warn"
title: string
expiration?: number
}

export type ISendVCSNotification = (args: ISendNotificationsArgs) => void
Expand Down Expand Up @@ -62,11 +63,11 @@ export class VersionControlManager {
}

// Use arrow function to maintain this binding of sendNotification
public sendNotification: ISendVCSNotification = ({ detail, level, title }) => {
public sendNotification: ISendVCSNotification = ({ expiration = 3_000, ...args }) => {
const notification = this._notifications.createItem()
notification.setContents(title, detail)
notification.setExpiration(3_000)
notification.setLevel(level)
notification.setContents(args.title, args.detail)
notification.setExpiration(expiration)
notification.setLevel(args.level)
notification.show()
}

Expand Down Expand Up @@ -140,6 +141,8 @@ export class VersionControlManager {
this._workspace,
this._vcsProvider,
this.sendNotification,
this._commands,
this._sidebar,
store,
)
this._sidebar.add("code-fork", vcsPane)
Expand Down Expand Up @@ -170,15 +173,27 @@ export class VersionControlManager {
}

private _registerCommands = () => {
const toggleVCS = () => {
this._sidebar.toggleVisibilityById("oni.sidebar.vcs")
}

this._commands.registerCommand({
command: "vcs.sidebar.toggle",
name: "Version Control: Toggle Visibility",
detail: "Toggles the vcs pane in the sidebar",
execute: toggleVCS,
enabled: () => this._configuration.getValue("experimental.vcs.sidebar"),
})

this._commands.registerCommand({
command: `oni.${this._vcs}.fetch`,
command: `vcs.fetch`,
name: "Fetch the selected branch",
detail: "",
execute: this._fetchBranch,
})

this._commands.registerCommand({
command: `oni.${this._vcs}.branches`,
command: `vcs.branches`,
name: `Local ${capitalize(this._vcs)} Branches`,
detail: "Open a menu with a list of all local branches",
execute: this._createBranchList,
Expand All @@ -194,6 +209,7 @@ export class VersionControlManager {
}

try {
// FIXME: there is race condition on deactivation of the provider
const branch = await this._vcsProvider.getBranch()
const diff = await this._vcsProvider.getDiff()

Expand Down
Loading