From 6f30788a16af2a9a3710439192ab7ec22a7975c4 Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Wed, 24 Jul 2024 13:06:59 +0200 Subject: [PATCH] fix(zsh): correct logic to enable tooltips resolves #5288 --- src/shell/scripts/omp.zsh | 11 ++++++++++- src/shell/zsh.go | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/shell/scripts/omp.zsh b/src/shell/scripts/omp.zsh index f0fbb61b..41bdb765 100644 --- a/src/shell/scripts/omp.zsh +++ b/src/shell/scripts/omp.zsh @@ -190,6 +190,15 @@ function _omp_create_widget() { esac } +function enable_poshtooltips() { + widget=${$(bindkey " "):2} + + if [[ -z $widget ]]; then + widget=self-insert + fi + + _omp_create_widget $widget _omp_render_tooltip +} + # legacy functions -function enable_poshtooltips() {} function enable_poshtransientprompt() {} diff --git a/src/shell/zsh.go b/src/shell/zsh.go index 53727e4c..6465194b 100644 --- a/src/shell/zsh.go +++ b/src/shell/zsh.go @@ -12,7 +12,7 @@ func (f Feature) Zsh() Code { case CursorPositioning: return "_omp_cursor_positioning=1" case Tooltips: - return "_omp_create_widget self-insert _omp_render_tooltip" + return "enable_poshtooltips" case Transient: return "_omp_create_widget zle-line-init _omp_zle-line-init" case FTCSMarks: