Skip to content

Commit a61976e

Browse files
committed
Merge pull request #257 from nightroman/master
Set-PSReadlineKeyHandler -Key F7 - two minor tweaks
2 parents 771ff17 + fe10433 commit a61976e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

PSReadLine/SamplePSReadlineProfile.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Set-PSReadlineKeyHandler -Key F7 `
3333
$pattern = [regex]::Escape($pattern)
3434
}
3535

36-
$history = [System.Collections.ArrayList]$(
36+
$history = [System.Collections.ArrayList]@(
3737
$last = ''
3838
$lines = ''
3939
foreach ($line in [System.IO.File]::ReadLines((Get-PSReadlineOption).HistorySavePath))
@@ -60,7 +60,8 @@ Set-PSReadlineKeyHandler -Key F7 `
6060

6161
if (($line -cne $last) -and (!$pattern -or ($line -match $pattern)))
6262
{
63-
($last = $line)
63+
$last = $line
64+
$line
6465
}
6566
}
6667
)

0 commit comments

Comments
 (0)