git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Shulhan <ms@kilabit.info>
To: git@vger.kernel.org
Cc: paulus@ozlabs.org, Shulhan <ms@kilabit.info>
Subject: [PATCH] gitk: fix error when resizing gitk
Date: Thu, 25 Nov 2021 19:57:20 +0700	[thread overview]
Message-ID: <20211125125720.231039-1-ms@kilabit.info> (raw)

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. Either the email is not received or somethings
in between.

[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


             reply	other threads:[~2021-11-25 13:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-25 12:57 Shulhan [this message]
2022-02-23 15:03 ` [PATCH] gitk: fix error when resizing gitk Halil SEN
2022-02-23 17:16   ` Shulhan
  -- strict thread matches above, loose matches on Subject: below --
2021-11-21  7:33 Shulhan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211125125720.231039-1-ms@kilabit.info \
    --to=ms@kilabit.info \
    --cc=git@vger.kernel.org \
    --cc=paulus@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).