Didn't the short cut "q" quit the `fossil diff -tk` graphical diff
application, for good, since a while, I wondered, this days. Turns out,
that in fact it was there, after initial it wasn't, but was disabled
with http://fossil-scm.org/index.html/info/f6d9583173cbd6d2

The patch below use one way to fix the problem with q (etc) keystrokes
in search not meaning the plea to quit the app while preserveing the
handy keyboard short cuts outside of this.

I've added also an <Escape> binding to the serach entry to be able to
leave the search without using the mouse, but that is minor. Just give
us the "q" short cut key back, please.

Index: src/diff.tcl
==================================================================
--- src/diff.tcl
+++ src/diff.tcl
@@ -227,18 +227,17 @@
 }
 
 wm withdraw .
 wm title . $CFG(TITLE)
 wm iconname . $CFG(TITLE)
-# Keystroke bindings for on the top-level window for navigation and
-# control also fire when those same keystrokes are pressed in the
-# Search entry box.  Disable them, to prevent the diff screen from
-# disappearing abruptly and unexpectedly when searching for "q".
+# Top-level window keystroke bindings for navigation and control.
+# Prevent them to also fire when those same keystrokes are pressed in
+# the search entry box.
 #
-# bind . <q> exit
-# bind . <p> {catch searchPrev; break}
-# bind . <n> {catch searchNext; break}
+bind . <q> {if {"%W" ne ".bb.sframe.e"} exit}
+bind . <p> {if {"%W" ne ".bb.sframe.e"} {catch searchPrev; break}}
+bind . <n> {if {"%W" ne ".bb.sframe.e"} {catch searchNext; break}}
 # bind . <Escape><Escape> exit
 bind . <Destroy> {after 0 exit}
 bind . <Tab> {cycleDiffs; break}
 bind . <<PrevWindow>> {cycleDiffs 1; break}
 bind . <Control-f> {searchOnOff; break}
@@ -400,10 +399,11 @@
   } else {
     set ::search .txtA
     if {![winfo exists .bb.sframe]} {
       frame .bb.sframe
       ::ttk::entry .bb.sframe.e -width 10
+      bind .bb.sframe.e <Escape> {searchOnOff; focus .bb.search}
       pack .bb.sframe.e -side left -fill y -expand 1
       bind .bb.sframe.e <Return> {searchNext; break}
       ::ttk::button .bb.sframe.nx -text \u2193 -width 1 -command searchNext
       ::ttk::button .bb.sframe.pv -text \u2191 -width 1 -command searchPrev
       tk_optionMenu .bb.sframe.typ ::search_type \




_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to