Skip to content

Commit

Permalink
Merge pull request dahlbyk#566 from dahlbyk/from-master
Browse files Browse the repository at this point in the history
Update develop from master
  • Loading branch information
dahlbyk authored Apr 20, 2018
2 parents 554b881 + 37e5ba7 commit f41ff1e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
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

0 comments on commit f41ff1e

Please sign in to comment.