From: "halilsen via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Paul Mackerras <paulus@ozlabs.org>,
Anders Kaseorg <andersk@mit.edu>,
Junio C Hamano <gitster@pobox.com>,
Halil Sen <halilsen@gmail.com>,
halilsen <halil.sen@mapotempo.com>
Subject: [PATCH 2/2] gitk: include y coord in recorded sash position
Date: Sun, 20 Feb 2022 19:47:36 +0000 [thread overview]
Message-ID: <0b5b8fb591e434a2a24b1f58d1ce3fc7da48a28e.1645386457.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1219.git.git.1645386457.gitgitgadget@gmail.com>
From: halilsen <halil.sen@mapotempo.com>
6cd80496e9 ("gitk: Resize panes correctly when reducing window size",
2020-10-03) introduces a mechanism to record previously-set sash
positions to make sure that correct values are used while computing
resize proportions. However, if we are not using ttk, then sash
represents only the x coordinate and the recorded sash (`oldsash`) only
includes the x coordinate. When we need to access the y coordinate via
the recorded sash position, we generate the following Application Error
popup:
Error: expected integer but got ""
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 2818"
(command bound to event)
To fix this, if we are not using ttk, we append the sash positions with
the y coordinates before recording them to match the use_ttk case.
Signed-off-by: Halil Sen <halil.sen@gmail.com>
---
gitk-git/gitk | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index c31a8b4e2f8..0ae7d685904 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -2991,6 +2991,8 @@ proc resizeclistpanes {win w} {
} else {
$win sash place 0 $sash0 [lindex $s0 1]
$win sash place 1 $sash1 [lindex $s1 1]
+ set sash0 [list $sash0 [lindex $s0 1]]
+ set sash1 [list $sash1 [lindex $s1 1]]
}
set oldsash($win) [list $sash0 $sash1]
}
@@ -3023,6 +3025,7 @@ proc resizecdetpanes {win w} {
$win sashpos 0 $sash0
} else {
$win sash place 0 $sash0 [lindex $s0 1]
+ set sash0 [list $sash0 [lindex $s0 1]]
}
set oldsash($win) $sash0
}
--
gitgitgadget
prev parent reply other threads:[~2022-02-20 19:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-20 19:47 [PATCH 0/2] gitk: include y coord in recorded sash position Halil Sen via GitGitGadget
2022-02-20 19:47 ` [PATCH 1/2] gitk: trivial indentation fix halilsen via GitGitGadget
2022-02-20 19:47 ` halilsen via GitGitGadget [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0b5b8fb591e434a2a24b1f58d1ce3fc7da48a28e.1645386457.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=andersk@mit.edu \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=halil.sen@mapotempo.com \
--cc=halilsen@gmail.com \
--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.
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 NNTP newsgroup(s).