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 to prompt func to allow path/status order swap #544

Merged
merged 11 commits into from
Apr 19, 2018
10 changes: 3 additions & 7 deletions src/posh-git.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ $GitPromptScriptBlock = {
$prompt = ''

# Write default prompt prefix if not empty.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess we should change the comment to just # Write default prompt prefix.

if ($settings.DefaultPromptPrefix.Text) {
$prompt += Write-Prompt $settings.DefaultPromptPrefix.Expand()
}
$prompt += Write-Prompt $settings.DefaultPromptPrefix.Expand()

# Get the current path - formatted correctly
$promptPath = $settings.DefaultPromptPath.Expand()
Expand All @@ -79,12 +77,10 @@ $GitPromptScriptBlock = {
}

# Write default prompt middle if not empty.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto - drop the if not empty bit.

if ($settings.DefaultPromptBeforeSuffix.Text) {
$prompt += Write-Prompt $settings.DefaultPromptBeforeSuffix.Expand()
}
$prompt += Write-Prompt $settings.DefaultPromptBeforeSuffix.Expand()

# If stopped in the debugger, the prompt needs to indicate that by writing default propmt debug
if ($settings.DefaultPromptDebug.Text -and ((Test-Path Variable:/PSDebugContext) -or [runspace]::DefaultRunspace.Debugger.InBreakpoint)) {
if ((Test-Path Variable:/PSDebugContext) -or [runspace]::DefaultRunspace.Debugger.InBreakpoint) {
$prompt += Write-Prompt $settings.DefaultPromptDebug.Expand()
}

Expand Down