From 032e3583bd4189f0cba16d1f39f9066e3f7e4c49 Mon Sep 17 00:00:00 2001 From: Jorge Morante Date: Wed, 13 Sep 2023 16:48:01 +0200 Subject: [PATCH] resize fingers window before rendering to avoid line jumping --- src/fingers/commands/start.cr | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/fingers/commands/start.cr b/src/fingers/commands/start.cr index 1ac0ed5..a478962 100644 --- a/src/fingers/commands/start.cr +++ b/src/fingers/commands/start.cr @@ -58,11 +58,17 @@ module Fingers::Commands end private def show_hints + # Attention! It is very important to resize the window at this point to + # match the dimensions of the target pane. Otherwise weird linejumping + # will occur when we have wrapped lines. + tmux.resize_window( + fingers_window.window_id, + target_pane.pane_width, + target_pane.pane_height, + ) + view.render - - fingers_pane_id = fingers_window.pane_id - - tmux.swap_panes(fingers_pane_id, target_pane.pane_id) + tmux.swap_panes(fingers_window.pane_id, target_pane.pane_id) end private def handle_input