Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Export TabExpansion from module instead of defining in profile

  • Loading branch information...
commit 1bd7604cfb9a15f1cf8e0f1e681c335bd63c8b12 1 parent 663e3f3
@dahlbyk dahlbyk authored
Showing with 17 additions and 18 deletions.
  1. +16 −0 HgTabExpansion.ps1
  2. +1 −1  posh-hg.psm1
  3. +0 −17 profile.example.ps1
View
16 HgTabExpansion.ps1
@@ -224,4 +224,20 @@ function thgCommands($filter) {
}
$cmdList | sort
+}
+
+if(-not (Test-Path Function:\DefaultTabExpansion)) {
+ Rename-Item Function:\TabExpansion DefaultTabExpansion
+}
+
+# Set up tab expansion and include hg expansion
+function TabExpansion($line, $lastWord) {
+ $lastBlock = [regex]::Split($line, '[|;]')[-1]
+
+ switch -regex ($lastBlock) {
+ # mercurial and tortoisehg tab expansion
+ '(hg|thg) (.*)' { HgTabExpansion($lastBlock) }
+ # Fall back on existing tab expansion
+ default { DefaultTabExpansion $line $lastWord }
+ }
}
View
2  posh-hg.psm1
@@ -7,7 +7,7 @@ Pop-Location
Export-ModuleMember -Function @(
'Get-HgStatus',
- 'HgTabExpansion',
+ 'TabExpansion',
'Get-MqPatches',
'PopulateHgCommands'
)
View
17 profile.example.ps1
@@ -17,21 +17,4 @@ function prompt {
return "> "
}
-if(-not (Test-Path Function:\DefaultTabExpansion)) {
- Rename-Item Function:\TabExpansion DefaultTabExpansion
-}
-
-# Set up tab expansion and include hg expansion
-function TabExpansion($line, $lastWord) {
- $lastBlock = [regex]::Split($line, '[|;]')[-1]
-
- switch -regex ($lastBlock) {
- # mercurial and tortoisehg tab expansion
- '(hg|thg) (.*)' { HgTabExpansion($lastBlock) }
- # Fall back on existing tab expansion
- default { DefaultTabExpansion $line $lastWord }
- }
-}
-
-
Pop-Location
Please sign in to comment.
Something went wrong with that request. Please try again.