On Friday, August 12, 2011, Ryosuke Niwa <[email protected]> wrote: > On Fri, Aug 12, 2011 at 3:11 PM, Ehsan Akhgari <[email protected]> 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
