From: Luuk van Baal Date: Tue, 14 Dec 2021 16:16:56 +0000 (+0100) Subject: Replace restorepreview workaround X-Git-Tag: v4.5~42^2~13^2~1 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=e0c1ed273f1576484de2d57a7f739748292262b6;p=nnn.git Replace restorepreview workaround --- diff --git a/patches/restorepreview/mainline.diff b/patches/restorepreview/mainline.diff index b0118514..402eeea9 100644 --- a/patches/restorepreview/mainline.diff +++ b/patches/restorepreview/mainline.diff @@ -1,5 +1,8 @@ -# Description: Adds preview pipe to enable closing and re-opening -# the preview pane when running an undetached editor. +# Description: Adds preview pipe to enable closing and re-opening the preview +# pane when running an undetached editor. If you are using vim +# you might experience incorrectly resized window. Consider adding +# the following to your vimrc: +# autocmd VimEnter * :silent exec "!kill -s WINCH $PPID" # # Authors: Luuk van Baal diff --git a/plugins/preview-tui b/plugins/preview-tui index c718af40..6af3d658 100755 --- a/plugins/preview-tui +++ b/plugins/preview-tui @@ -415,7 +415,7 @@ preview_fifo() { if [ -n "$selection" ]; then kill "$(cat "$PREVIEWPID")" [ -p "$FIFO_UEBERZUG" ] && ueberzug_remove - [ "$selection" = "close" ] && sleep 0.15 && pkill -P "$$" && exit + [ "$selection" = "close" ] && break preview_file "$selection" printf "%s" "$selection" > "$CURSEL" fi