From 03f15681d5297a8e63884dffdceab0c987ecdb0f Mon Sep 17 00:00:00 2001 From: metasong Date: Tue, 8 Nov 2022 09:21:20 -0600 Subject: [PATCH] enhance the Invoke-FzfPsReadlineHandlerProvider `copy c:\programs\(cursor here) d:\apps` press ctrl-t to trigger function Invoke-FzfPsReadlineHandlerProvider, then select some path will expand --- PSFzf.Base.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PSFzf.Base.ps1 b/PSFzf.Base.ps1 index 39b2ec0..220db1b 100644 --- a/PSFzf.Base.ps1 +++ b/PSFzf.Base.ps1 @@ -752,6 +752,9 @@ function Invoke-FzfPsReadlineHandlerProvider { if ($rightCursor -eq 0 -and $leftCursor -eq 0) { [Microsoft.PowerShell.PSConsoleReadLine]::Insert($str) } else { + if($resolvedPath) { + $str = join-path $resolvedPath $str + } [Microsoft.PowerShell.PSConsoleReadLine]::Replace($leftCursor,$replaceLen+1,$str) } }