W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2011

[whatwg] Fixing undo on the Web - UndoManager and Transaction

From: Jonas Sicking <jonas@sicking.cc>
Date: Sat, 13 Aug 2011 14:22:59 -0700
Message-ID: <CA+c2ei88HVK1e7ghFAz=feGFwReWEgsoVjT9iinUK_wu1fRtUw@mail.gmail.com>
On Friday, August 12, 2011, Ryosuke Niwa <rniwa at webkit.org> wrote:
> On Fri, Aug 12, 2011 at 3:11 PM, Ehsan Akhgari <ehsan at mozilla.com> wrote:
>>
>> On 11-08-12 6:10 PM, Ryosuke Niwa wrote:
>>>
>>> But having authors add flag in almost all cases isn't that nice either.
>>
>> Why do you think that authors need to specify the flag in almost all
cases?
>
> Because almost all text editing operations need to restore selection upon
redo.

One option would be to have just one function, but pass it boolean
indicating if it's the first application or a redo. That way it's easy to
surround the selection management with "if (reapply)"

This seems to combine the best of both proposals. No encoring code
duplication, but still easy to have reapply-specific code paths such as
selection management.

/ Jonas
Received on Saturday, 13 August 2011 14:22:59 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:35 UTC