limited undo.

Again I am bitten by the limited undo functionality of LibreOffice.

Task:

undo the writing of about 6 lines of text and the single delete that went before that.

Result:

fail. The undo buffer is already depleted before it has undone the writing of those 6 lines of text, so it cannot yet also undo the deletion, that I needed to get back.

Hello,

The size of the undo buffer seems controlled by a property that is
accessible in the Advanced settings (via options). Look for

org.openoffice.Office.Common

and then look for the property Undo and change the value of Steps.

My setup has 100 as number of steps which, like you point, out may be
insufficient for remembering the typing of 6 lines of text. You could
probably increase that number to some higher number (I have not tried
it myself so you will be in uncharted territory) to have a larger undo
buffer and this way be able to undo more steps (you may have to restart
LO at that point for it to use the new value). Note that this will have
an impact on memory usage and maybe on global performance depending on
the system you use to run LO.

I hope this helps.

Rémy Gauthier.

m.a.riosv wrote

Since 5.1 undo step are available only into the expert configuration
Menu/Tools/Options/LibreOffice/Advanced - TOpen expert configuration.
Verify if steps value is enough, default value is 100.

<http://nabble.documentfoundation.org/file/n4192514/Captura.png>

And be aware that each character entered & corrected is an *undo* step, and
that each full word and word boundary are each *undo* steps. So for an
average typist the 100 step "*undo*" covers only about two full lines of
text entry.

So from Tools -> Options -> Advanced: "Expert Configuration" the
Office.Common "Undo" value need to be set to ~300, to cover six lines. And
increase as you'd like to be able to address--down side is memory usage and
loss of responsiveness can grow.

Since 5.1 undo step are available only into the expert configuration
Menu/Tools/Options/LibreOffice/Advanced - TOpen expert configuration.
Verify if steps value is enough, default value is 100.

<http://nabble.documentfoundation.org/file/n4192514/Captura.png>

To be honest, I believe that a proper use of Writer could avoid this
"problem".

What I mean is that probably it could be enough to delete word by word,
using CTRL key together with BackSpace or Delete key. In this way it should
take one step of undo per each word, instead of a single character.

Also consider selecting and THEN delete. For example you could use Shift
with Home and End keys or with CTRL and arrows keys...

Word processing IS NOT exactly like using a typewriter :wink:

Gabriele Ponzo schreef op 03-09-2016 19:40:

To be honest, I believe that a proper use of Writer could avoid this
"problem".

What I mean is that probably it could be enough to delete word by word,
using CTRL key together with BackSpace or Delete key. In this way it should
take one step of undo per each word, instead of a single character.

Also consider selecting and THEN delete. For example you could use Shift
with Home and End keys or with CTRL and arrows keys...

Word processing IS NOT exactly like using a typewriter :wink:

You misinterpret this.

We are not talking about deleting things step by step, but undoing things step by step, which is hardcoded. We are not talking of forcing individual deletes into the undo buffer, but of seeing individual "restores" being taken out of the undo buffer.

These individual restores result from individual character presses while typing.

They are not grouped together like in other applications.

Sorry for my misunderstanding :slight_smile:

Philip Jackson schreef op 04-09-2016 15:58:

[…]
They are not grouped together like in other applications.

Ok, I got it now.

Sorry for my misunderstanding :slight_smile:
---
Gabriele Ponzo

Hi - wait a minute. I think Gabriele has it right according to the way I
understand the OP's problem.

No my friend, it is as I said.

I am not deleting text.

I am undoing writes.

Work flow:

type text
delete block of text
rewrite block of text
figure I was wrong in deleting it
undo the writing
undelete the block I just deleted

The deletion happend in one block.

However the writing happens by character and it doesn't coalesce or merge them into words in the undo buffer.

Since, in order to get back to my previous text, that I deleted in one operation, I have to go through the undo buffer (since it is sequential in history) I first have to undo the writing I just did.

But the writing took up one undelete step per character and quickly expunged or evacuated the delete buffer from the history.

At one point that delete buffer was there. But writing individual characters takes up so much undelete steps and they are not merged together in memory (so as to form, for example, words) even a modest amount of typing will quickly fill the undo buffer completely and thereby delete the delete buffer that existed prior.

It is thrown out of memory because those 100 characters quickly fill up the "chain".

So, you can't get your text back because LO threw it away.

And really.... for no other reason than that it treats single characters the same as huge blocks of text. It will happily remember a block of 5k. That you just deleted, for instance. But it also happily remembers blocks of 1 character, and it treats all of those blocks the same.

It has no qualms remembering 100 blocks of 5k. It also has no qualms remembring 100 blocks of 1. It has huge qualms, in that sense, about remembering one block of 5k and 100 blocks of 1. After the 100th block of 1, it will dump that one block of 5k that preceded it.

Not only is this just stupid in terms of remembering what is important, or remembering it in a way that makes sense for getting text back, it also makes undoing typed text a character-by-character process when other programs would usually undo in blocks (by word, for example, or by group of words).

Now this was the same in OpenOffice and just hasn't been changed since.

I just can't help but think it is not a very good idea to do it in this way.

Most other program I know internally merge the characters into words when remembering them.

So say you write a word and a word boundary.

Then the next word and word boundary you write will cause the engine to look back into the undo buffer and check the previous word boundary, then merge everything in between into one word undo.

Or, likewise, or conversely, it can put every character you type into the previous undo buffer so you can only undo words that are delimited by a word boundary (or interspersed and as such delimited by other actions such as deletes or pastes or whatever).

Then when the next word is reached, a new undo buffer is created for that new word. But I think most programs actively rewrite their history to group characters into words and words into blocks of words. They do this to have a sort of logarithmic view on the undo history in which older events get grouped together into bigger writes, while more recent events are kept smaller.

If you also remember a time stamp with each undo block then it is rather easy also to merge blocks of words based on time. But it gets more complicated that way.

A simple heuristic of "more than 8 words in the past: group the preceding block of 8 words into one buffer. Have started a new paragraph? turn the paragraph before the previous into one block.

I don't know how people usually do it. But most any program has it. You could even look at the algo for Webkit/Chromium, or Kate, for all you cared.

Maybe they even use common libraries for it. It's just that it's not that hard to do it yourself and if your engine even supported the minimum which would be grouping into words, you would already get very far. Now your buffer of 100 steps is 100 words instead of 100 characters, mostly.

And that really doesn't take any memory okay.

Such a rewrite of the previous word could probably done in less than a 100 clock cycles ;-).

Well, if you did it in assembler.

Not saying I can do it.

Just saying it is not going to be a performance hindrance.

I also cannot really imagine the amount of memory required for words as opposed to single characters is going to make a dent in your memory consumption.

Most of the memory you require is overhead anyway, probably, for such small chunks.

Anyway.

No my friend, it is as I said.

...

Work flow:

type text
delete block of text
rewrite block of text
figure I was wrong in deleting it
undo the writing
undelete the block I just deleted

The deletion happend in one block.

However the writing happens by character and it doesn't coalesce or
merge them into words in the undo buffer.

Since, in order to get back to my previous text, that I deleted in one
operation, I have to go through the undo buffer (since it is sequential
in history) I first have to undo the writing I just did.

Thanks for the detailed explanation. I see what you mean.

My understanding of the problem was at fault. Sorry.

Philip