mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
feat(tooltip): make .Code
property available
This commit is contained in:
parent
0895aca72e
commit
01164cfcc9
|
@ -39,7 +39,7 @@ function fish_right_prompt
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if test -n "$omp_tooltip_command"
|
if test -n "$omp_tooltip_command"
|
||||||
set omp_tooltip_prompt ('::OMP::' print tooltip --config $POSH_THEME --shell fish --shell-version $FISH_VERSION --command $omp_tooltip_command)
|
set omp_tooltip_prompt ('::OMP::' print tooltip --config $POSH_THEME --shell fish --error $omp_status_cache --shell-version $FISH_VERSION --command $omp_tooltip_command)
|
||||||
if test -n "$omp_tooltip_prompt"
|
if test -n "$omp_tooltip_prompt"
|
||||||
echo -n $omp_tooltip_prompt
|
echo -n $omp_tooltip_prompt
|
||||||
set omp_tooltip_command ""
|
set omp_tooltip_command ""
|
||||||
|
|
|
@ -113,7 +113,7 @@ local function set_posh_tooltip(command)
|
||||||
command = string.gsub(command, '\\+"', '%1%1"')
|
command = string.gsub(command, '\\+"', '%1%1"')
|
||||||
command = string.gsub(command, '\\+$', '%1%1')
|
command = string.gsub(command, '\\+$', '%1%1')
|
||||||
command = string.gsub(command, '"', '\\"')
|
command = string.gsub(command, '"', '\\"')
|
||||||
local prompt_exe = string.format('%s print tooltip --shell=cmd --config=%s --command="%s"', omp_exe(), omp_config(), command)
|
local prompt_exe = string.format('%s print tooltip --shell=cmd %s --config=%s --command="%s"', omp_exe(), error_level_option(), omp_config(), command)
|
||||||
local tooltip = run_posh_command(prompt_exe)
|
local tooltip = run_posh_command(prompt_exe)
|
||||||
if tooltip ~= "" then
|
if tooltip ~= "" then
|
||||||
tooltip_active = true
|
tooltip_active = true
|
||||||
|
|
|
@ -107,7 +107,7 @@ New-Module -Name "oh-my-posh-core" -ScriptBlock {
|
||||||
$cleanPWD, $cleanPSWD = Get-PoshContext
|
$cleanPWD, $cleanPSWD = Get-PoshContext
|
||||||
$command = $null
|
$command = $null
|
||||||
[Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$command, [ref]$null)
|
[Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$command, [ref]$null)
|
||||||
$standardOut = @(Start-Utf8Process $script:OMPExecutable @("print", "tooltip", "--pwd=$cleanPWD", "--shell=$script:ShellName", "--pswd=$cleanPSWD", "--config=$env:POSH_THEME", "--command=$command", "--shell-version=$script:PSVersion"))
|
$standardOut = @(Start-Utf8Process $script:OMPExecutable @("print", "tooltip", "--error=$script:ErrorCode", "--pwd=$cleanPWD", "--shell=$script:ShellName", "--pswd=$cleanPSWD", "--config=$env:POSH_THEME", "--command=$command", "--shell-version=$script:PSVersion"))
|
||||||
Write-Host $standardOut -NoNewline
|
Write-Host $standardOut -NoNewline
|
||||||
$host.UI.RawUI.CursorPosition = $position
|
$host.UI.RawUI.CursorPosition = $position
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ function self-insert() {
|
||||||
fi
|
fi
|
||||||
# trigger a tip check only if the input is a space character
|
# trigger a tip check only if the input is a space character
|
||||||
if [[ "$KEYS" = " " ]]; then
|
if [[ "$KEYS" = " " ]]; then
|
||||||
tooltip=$(::OMP:: print tooltip --config="$POSH_THEME" --shell=zsh --command="$BUFFER" --shell-version="$ZSH_VERSION")
|
tooltip=$(::OMP:: print tooltip --config="$POSH_THEME" --shell=zsh --error="$omp_last_error" --command="$BUFFER" --shell-version="$ZSH_VERSION")
|
||||||
fi
|
fi
|
||||||
# ignore an empty tooltip
|
# ignore an empty tooltip
|
||||||
if [[ ! -z "$tooltip" ]]; then
|
if [[ ! -z "$tooltip" ]]; then
|
||||||
|
|
Loading…
Reference in a new issue