From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 8ADF11F953 for ; Thu, 25 Nov 2021 14:23:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352963AbhKYO03 (ORCPT ); Thu, 25 Nov 2021 09:26:29 -0500 Received: from vmi563313.contaboserver.net ([62.171.181.13]:60896 "EHLO vmi563313.contaboserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350311AbhKYOY2 (ORCPT ); Thu, 25 Nov 2021 09:24:28 -0500 Received: from inspiro.localdomain (unknown [182.253.127.221]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by vmi563313.contaboserver.net (Postfix) with ESMTPSA id 782A6AC086B; Sun, 21 Nov 2021 07:33:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kilabit.info; s=20210411-1; t=1637480027; bh=dnzCD2gxXsx2cnIsb70VBv/Kn/mvadCdbOBCKKC9VdE=; h=From:To:Cc:Subject:Date; b=GYUgGArcfO+yxX1tpMY6XuhNeIttl6xS2zwL7+WviMto8CUSI3W+HVqUoHvWEEbSa yhc5gdesr1rvZvKX6rDS+W9CpZuGuhU+2GpCGa0Y6gzMmuaPUfnNdUkfMit5DKhhKC fB9sotZ4akUwFBaPgAV7FiSqV5rLaWF5pCMq/I7o= From: Shulhan To: git@vger.kernel.org Cc: paulus@ozlabs.org, Shulhan Subject: [PATCH] gitk: fix error when resizing gitk Date: Sun, 21 Nov 2021 14:33:37 +0700 Message-Id: <20211121073337.1953186-1-ms@kilabit.info> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 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 --- 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