Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update develop from master #566

Merged
merged 9 commits into from
Apr 20, 2018
9 changes: 9 additions & 0 deletions src/GitPrompt.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -862,8 +862,17 @@ $PoshGitVcsPrompt = {
$errorText = "PoshGitVcsPrompt error: $_"
$sb = [System.Text.StringBuilder]::new()

# When prompt is first (default), place the separator before the status summary
if (!$s.DefaultPromptWriteStatusFirst) {
$sb | Write-Prompt $s.PathStatusSeparator > $null
}
$sb | Write-Prompt $s.BeforeStatus > $null

$sb | Write-Prompt $errorText -Color $s.ErrorColor > $null
if ($s.Debug) {
if (!$s.AnsiConsole) { Write-Host }
Write-Verbose "PoshGitVcsPrompt error details: $($_ | Format-List * -Force | Out-String)" -Verbose
}
$sb | Write-Prompt $s.AfterStatus > $null

$sb.ToString()
Expand Down
12 changes: 6 additions & 6 deletions src/GitTabExpansion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ function script:expandParamValues($cmd, $param, $filter) {
ForEach-Object { -join ("--", $param, "=", $_) }
}

function GitTabExpansion($lastBlock) {
$res = Invoke-Utf8ConsoleCommand { GitTabExpansionInternal $lastBlock $Global:GitStatus }
function Expand-GitCommand($Command) {
$res = Invoke-Utf8ConsoleCommand { GitTabExpansionInternal $Command $Global:GitStatus }
$res
}

Expand Down Expand Up @@ -403,7 +403,7 @@ if ($PowerTab_RegisterTabExpansion) {
$line = $Context.Line
$lastBlock = [regex]::Split($line, '[|;]')[-1].TrimStart()
$TabExpansionHasOutput.Value = $true
GitTabExpansion $lastBlock
Expand-GitCommand $lastBlock
}
return
}
Expand All @@ -417,9 +417,9 @@ function TabExpansion($line, $lastWord) {

switch -regex ($lastBlock) {
# Execute git tab completion for all git-related commands
"^$(Get-AliasPattern git) (.*)" { GitTabExpansion $lastBlock }
"^$(Get-AliasPattern tgit) (.*)" { GitTabExpansion $lastBlock }
"^$(Get-AliasPattern gitk) (.*)" { GitTabExpansion $lastBlock }
"^$(Get-AliasPattern git) (.*)" { Expand-GitCommand $lastBlock }
"^$(Get-AliasPattern tgit) (.*)" { Expand-GitCommand $lastBlock }
"^$(Get-AliasPattern gitk) (.*)" { Expand-GitCommand $lastBlock }

# Fall back on existing tab expansion
default {
Expand Down
1 change: 1 addition & 0 deletions src/posh-git.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ PowerShellVersion = '5.0'
# Functions to export from this module
FunctionsToExport = @(
'Add-PoshGitToProfile',
'Expand-GitCommand',
'Format-GitBranchName',
'Get-GitBranchStatusColor',
'Get-GitStatus',
Expand Down
1 change: 1 addition & 0 deletions src/posh-git.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ $ExecutionContext.SessionState.Module.OnRemove = {
$exportModuleMemberParams = @{
Function = @(
'Add-PoshGitToProfile',
'Expand-GitCommand',
'Format-GitBranchName',
'Get-GitBranchStatusColor',
'Get-GitDirectory',
Expand Down