]> Sergey Matveev's repositories - nnn.git/commitdiff
Replace restorepreview workaround
authorLuuk van Baal <luukvbaal@gmail.com>
Tue, 14 Dec 2021 16:16:56 +0000 (17:16 +0100)
committerLuuk van Baal <luukvbaal@gmail.com>
Tue, 14 Dec 2021 16:16:56 +0000 (17:16 +0100)
patches/restorepreview/mainline.diff
plugins/preview-tui

index b0118514c5ae3c26283fbda47d6a200a1920e2c6..402eeea93fec96be07030b27f911c235bba838e2 100644 (file)
@@ -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
 
index c718af408e3ec82ff43aebf546f534542c21ea7d..6af3d658338efa9ab0cf7fd607da5389294bf308 100755 (executable)
@@ -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