Re: [PATCH/RFC 1/2] Only transfer focus once when opening multiple file diffs



On 30 April 2012 14:27, Peter Tyser <ptyser gmail com> wrote:
> On Sat, Apr 28, 2012 at 10:24 PM, Kai Willadsen <kai willadsen gmail com> wrote:
>> ...and I've only just noticed something. This approach breaks when you
>> start any new comparison using the File -> New dialog from a file
>> comparison; the new tab isn't focussed, despite that definitely being
>> what we want. I'll see if I can't figure something out, but if you get
>> a chance to take a look, that would be awesome.
>
> Argh, I rarely use that method to initiate diffs and should have
> tested more - thanks for catching that.  The 2 solutions that jumped
> to mind are:
> 1. Adding a "xfer_focus" parameter to append_difdiff(),
> append_filediff(), append_vcview(), and potentially their callers.
> The File->New dialog path would then set "xfer_focus=True", while most
> other callers would set "xfer_focus=False" (or not specify it with a
> default of "False").
> 2. Adding a focus transfer when the File -> New dialog successfully closes.
>
> Neither seems perfect - 1 muddies up the API and would likely add some
> additional logic, and 2 makes it so the focus handling is done in more
> than 1 spot.  I've attached an example of #2.  Let me know if you have
> a preference between the 2 implementations, or have a better idea for
> a 3rd.

Yeah, I agree... neither is ideal, but I can live with the second. I
adapted your patch slightly to be more robust when our new tab isn't
necessarily the last tab (quite possible in the future) and committed
it. Thanks.

cheers,
Kai


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]