aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2020-08-02 11:08:30 +0000
committerGitHub <noreply@github.com>2020-08-02 11:08:30 +0000
commit8911c57eb2c76b294cf58e0b2891b7da5f1363b2 (patch)
tree16eaac964ba8a76f74c938df9d7d692940924c1c
parentUpdate ChangeLog (diff)
parentShow keyboard shortcuts in a consistent order in help (diff)
downloadw3m-8911c57eb2c76b294cf58e0b2891b7da5f1363b2.tar.gz
w3m-8911c57eb2c76b294cf58e0b2891b7da5f1363b2.zip
Merge pull request #134 from DavidSpickett/master
Show keyboard shortcuts in a consistent order in help
-rw-r--r--scripts/w3mhelp.cgi.in24
1 files changed, 14 insertions, 10 deletions
diff --git a/scripts/w3mhelp.cgi.in b/scripts/w3mhelp.cgi.in
index 348d5df..11f9b68 100644
--- a/scripts/w3mhelp.cgi.in
+++ b/scripts/w3mhelp.cgi.in
@@ -72,22 +72,26 @@ local (%funckeydesc, $key, $fname, $desc);
%funcname = (%funcname, %buf_funcname, %lineedit_funcname, %menu_funcname);
%funcdesc = (%funcdesc, %buf_funcdesc, %lineedit_funcdesc, %menu_funcdesc);
-while (($fname, $desc) = each %funcdesc) {
- $funckeydesc{$funcname{$fname}} = "$fname\n$desc\n";
+# sort for consistent order each time this is run
+foreach my $fname (sort keys %funcdesc) {
+ $funckeydesc{$funcname{$fname}} = "$fname\n$funcdesc{$fname}\n";
}
-while (($key, $fname) = each %keyfunc) {
+foreach $key (sort keys %keyfunc) {
$keydata{$key} && next;
- $funckeydesc{$funcname{$fname}} .= "$key,";
+ $funckeydesc{$funcname{$keyfunc{$key}}} .= "$key,";
}
-while (($key, $fname) = each %buf_keyfunc) {
- $funckeydesc{$funcname{$fname}} .= "$key,";
+foreach $key (sort keys %buf_keyfunc) {
+ $keydata{$key} && next;
+ $funckeydesc{$funcname{$buf_keyfunc{$key}}} .= "$key,";
}
-while (($key, $fname) = each %lineedit_keyfunc) {
- $funckeydesc{$funcname{$fname}} .= "$key,";
+foreach $key (sort keys %lineedit_keyfunc) {
+ $keydata{$key} && next;
+ $funckeydesc{$funcname{$lineedit_keyfunc{$key}}} .= "$key,";
}
-while (($key, $fname) = each %menu_keyfunc) {
- $funckeydesc{$funcname{$fname}} .= "$key,";
+foreach $key (sort keys %menu_keyfunc) {
+ $keydata{$key} && next;
+ $funckeydesc{$funcname{$menu_keyfunc{$key}}} .= "$key,";
}
print <<HEADING;