Don't record (de)activating change tracking on undo stack
Daniel
xracoonx at gmx.de
Fri Dec 1 09:56:50 UTC 2023
On 2023-11-30 17:46, Lorenzo Bertini wrote:
> Il giorno gio 30 nov 2023 alle ore 15:47 Jean-Marc Lasgouttes
> <lasgouttes at lyx.org> ha scritto:
>>
>> Le 30/11/2023 à 03:01, Daniel a écrit :
>>> LyX has the peculiarity of treating the (de)activating of change
>>> tracking as something that is recorded on the undo stack.
>>
>> Actually, everything that is stored in the file goes to the undo stack.
>> I do not see how to avoid that.
>>
>>> One of the problems I ran into with this is that it unexpectedly killed
>>> the redo function when I activated change tracking, i.e. I undid some
>>> changes and activated the change tracking in between and this changed
>>> what could be redone.
>>>
>>> The only other app I know of that does this is Apple Pages. But I am not
>>> sure whether Apple's change tracking should be taken as a thought
>>> through feature, e.g. it is impossible to de-activate change tracking
>>> without accepting all changes. Go figure!
>>
>> Do other applications save change tracking status?
>>
>> Would you find it good that, if you open a file for the explicit purpose
>> of setting change tracking "on", then it will be necessary to fake
>> another change for the purpose of being able to save it? Or that undoing
>> all your changes may leave certain change unbeknownst to you?
>>
>> There might be another way to avoid killing the redo stack. Do you know
>> of any applicaiton that has a solution to this?
>>
>> JMarc
>
> I agree with Daniel, it caught me off guard the first time that
> document settings got in the way of undo-redo. Can't really tell what
> other word processors use, but what I expected was that undo-redo only
> applied to the text of the document. However, JMarc's point about not
> being able to save after a setting change is very valid. If anyone has
> libreoffice installed, how is this handled there?
>
> Lorenzo
I don't have enough insight into the LyX's undo mechanism, so I cannot
answer JMarc's first question concerning how this could be done in LyX
in particular.
General about the necessity to fake changes:
All of Writer, Word and Pages allow saving the document independently of
the "dirty" state. So, there is generally no problem with not being able
to save the document at any point. No faking needed.
In contrast, in LyX one already has to fake a change if one wants to
store e.g. close/open inset status.
By the way, Libre Writer indicates a dirty document with a "shiny disk"
(see also https://www.lyx.org/trac/ticket/12331).
Specifically about change tracking:
Other applications save the change tracking status as well.
In Writer and Word, the document is temporarily rendered dirty when
change tracking is activated but the undo stack is not touched. Meaning
that if one undoes changes since last save it would revert to not being
dirty without undoing change tracking status. But since one can still
save...
Seems sensible to me.
Pages does it as LyX including killing the undo stack.
Daniel
More information about the lyx-devel
mailing list