git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] gitk: fix error when resizing gitk

From
Shulhan <ms@kilabit.info>
Date
Nov 21, 2021, 07:33 UTC
Message-ID
<20211121073337.1953186-1-ms@kilabit.info>

When using gitk run on Wayland (in this case using sway window manager) and the window is vertical split, trying to resize the split will thrown the following error,

	expected integer but got ""
	expected integer but got ""
	    while executing
	"$win sash place 0 $sash0 [lindex $s0 1]"
	    (procedure "resizeclistpanes" line 38)
	    invoked from within
	"resizeclistpanes .tf.histframe.pwclist 983"
	    (command bound to event)
The issue is confirmed by Anders Kaseorg on the list [1].

This commit fix this issue by checking if the $s0 or $s1 is empty string, if its true set it to 0.

PS: I have send this patch to paulus@ozlabs.org, and it seems like there
is no reply since 7 Oct.
[1] https://public-inbox.org/git/1f6e179c-d9c3-e503-3218-0acf4ff27cca@mit.edu/
Signed-off-by: Shulhan <ms@kilabit.info>
---
 gitk-git/gitk | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 23d9dd1fe0..fc2add49b4 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -2989,8 +2989,16 @@ proc resizeclistpanes {win w} {
             $win sashpos 0 $sash0
             $win sashpos 1 $sash1
         } else {
-            $win sash place 0 $sash0 [lindex $s0 1]
-            $win sash place 1 $sash1 [lindex $s1 1]
+            set p0 [lindex $s0 1]
+            set p1 [lindex $s1 1]
+            if {$p0 eq ""} {
+                set p0 0
+            }
+            if {$p1 eq ""} {
+                set p1 0
+            }
+            $win sash place 0 $sash0 $p0
+            $win sash place 1 $sash1 $p1
         }
 	set oldsash($win) [list $sash0 $sash1]
     }
-- 
2.34.0
Message 1 of 1 in “gitk: fix error when resizing gitk”
  1. gitk: fix error when resizing gitkShulhan, Nov 21, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.