How can I prevent LO from accidentally overwriting selected (highlighted) text without me noticing?

When I’m editing existing documents sometimes I’m astonished to find entire words, sentences, or paragraphs missing from a document. I found out, that the cause is the general behavior of LO and most text-writers or editors.

The solution you could found two days ago already here
https://ask.libreoffice.org/t/new-option-im-lo-26-8-0-writer-now-allows-users-to-disable-typing-replaces-selection/137296/7
but an other community member had a problem with my post because there was no question as first post. :innocent:

LibreOffice 26.8.

tdf#169913

1 Like

Very funny
https://ask.libreoffice.org/t/new-option-im-lo-26-8-0-writer-now-allows-users-to-disable-typing-replaces-selection/137296/7

Yes, the standard behavior of LO is replacing highlighted text, this is very error-prone. On the other side there isn’t really any significant advantage of “Typing replaces selection”, because the selected text can be replaced fast by pressing the Delete key or a keyboard shortcut.
An other important error source for vanished (lost, extinct, disappeared, loss of) text is the cut an paste behavior of every word processor, but there are also a solution for LO. Details see here

The third error source for vanished text is Drag’n Drop, you also can disable this since LO 26.2. In this case text is not really vanished, but displaced, can be disastrous too or at least annoying.
Catching errors rather than relying on emergency repairs. This is standard practice in file managers. You can “disable Drag’n Drop” (at least adjust copy instead of move) and cut text is not deleted while not paste again (no data loss, when you forget to paste), other then in every word processor. No rational person would think to criticize this behavior of file managers.

Since the new LO 26.8.0 the Writer has now a new option that allows users to disable “Typing replaces selection”. Unfortunately, the TDF editor omitted this new feature from the LO 26.8.0 blog announcement five days ago

Something that is unimaginable, especially since it deprived the developers behind this patch (for the option) of the recognition they deserved for their work. Consequently, the topic is also being overlooked by online “specialist media” :lol:, as they apparently simply copy content from that blog post. Once again, one gets the unfortunate impression - sorry - that TDF has no real desire to encourage users to switch to LO, or perhaps simply lacks the competence to do so.

Credit for the patch goes to Andreas Heinisch and Heiko Tietze.

MSO has had this option since time immemorial - it was the only office suite to feature it until now - but it has finally been implemented in LO as well.

You can find it under Tools > Options > LibreOffice Writer > Formatting Aids (on the right, at the bottom under “Typing”).

Leaving “Typing Replaces Selection” enabled, on the other hand, offers no real, significant advantage, since selected text can be quickly deleted using the Delete key or a keyboard shortcut, rather than deleting it with every keystroke. The time saved while typing is minimal and is almost entirely offset anyway by the otherwise regular need to undo actions, if you even notice it (see below). Errors in the text that can result from this (see below for reasons and examples), on the other hand, are far more serious - even if they are merely cosmetic flaws, such as a missing word that the reader of a letter can infer.

What is the purpose of this option? Well, while it has historical roots, today it primarily serves to prevent accidental, unnoticed user errors - though, in reality, these aren’t so much user errors as they are the result of poor programming that fails to guard against such mistakes. I imagine almost every word processing user has experienced - to a greater or lesser extent - data loss or at least formatting glitches caused by this. Most people don’t notice it immediately; instead, they are often astonished to find entire words, sentences, or paragraphs missing from a document they had created and were editing. They don’t know why this happens, and most users aren’t even aware of the “Typing replaces selection” option in Word. That’s hardly surprising, given that - to my knowledge - the online tech press has never really covered the issue.
The watchword is interception rather than a stopgap solution. The “Undo” function is no solution for inadvertent errors, and backups are of little help here either - especially with newly created text, since one would have to painstakingly extract the lost sections from the backup files. A change log is also rarely appropriate here, either, because it’s often a time-consuming and otherwise cumbersome overkill. Errors should be avoided rather than corrected after the fact.
Such unnoticed errors can occur for a wide variety of reasons; describing them in detail would go beyond the scope of this answer, but at the end I have attended a few scenarios. There used to be a German Office manual called “Teialehrbuch” - available for free online - that clearly outlined some of the key scenarios, though unfortunately, it can no longer be found on the web. Nowadays, however, you can ask AI about this, though you have to probe a bit to get truly useful descriptions; since the topic has rarely been discussed online, AI often struggles with it on the first attempt.

This option can also be extremely helpful for older people and those with disabilities - likely one reason why it was introduced in near-record time following the enhancement request (id=169913). Theoretically, this feature is relevant to millions of word processing users, yet - as mentioned - it was previously exclusive to MS Office, and very few people are even aware of the issue; the TDF blog post mentioned above actually reinforces this lack of awareness. Consequently, very few users will likely utilize or appreciate this feature - a pity. At the very least, those who previously felt compelled to stick with MS Office because they regularly update and revise extensive documents can now switch.

Error Scenarios

Note: For letters and short texts - such as those typically written in a private or office setting - the following is less relevant, since errors are mostly noticed and corrected immediately or, at the latest, during proofreading. This applies more to longer documents, especially those that are revised regularly - and particularly those that are revised quickly. In such cases, it is not possible to proofread the entire document. Disabling this feature serves as a preventive measure against errors and to ensure data security.

When writing code in editors, however, different safety mechanisms are in place, and developers must remain highly focused anyway - unlike when writing regular text. But of course, such errors can still occur when writing code, and there are apparently editors that allow you to disable the “Typing replaces selection” feature.

Why you should disable the “Typing replaces selection” option / General description of the issue

  • Deliberately selected text can be deleted by an accidental keystroke; for instance, simply pressing the Pause key twice instead of once to wake the computer from standby mode is enough to trigger this. There are many other scenarios involving distraction, lack of concentration, etc. If this goes unnoticed, the consequences can be disastrous; in any case, it is annoying.
  • Accidentally selected text: Text is often accidentally selected while typing (e.g., by inadvertently sliding across or touching the touchpad, or unintentionally pressing a keyboard shortcut for text selection), and the next keystroke then deletes that text unintentionally. If this goes unnoticed, the consequences can be disastrous; in any case, it is equally annoying.
  • Disabling this option offers greater security while editing, especially for older people or those with motor impairments.
    See, for example: https://stackoverflow.com/questions/64717590/accessibility-tweak-in-libreoffice-how-to-prevent-accidentally-selected-text-fr

Individual (further) scenarios where the “error protection” provided by disabling this option might be relevant: There are numerous others - it is impossible for me to reconstruct them all now. The specific scenario matters less than the principle that errors should be prevented rather than having to be corrected later via Undo, backups, etc.

  1. A concrete example – formatting documents
    A long sentence is selected because you wanted to format it. You get distracted and start typing without noticing the selection. If the option is enabled, the original sentence is gone.
  2. Getting stuck on the Shift key (Something similar happens often in simple editors like Windows Notepad for some reason, parts of words or sentences sometimes vanish while typing.)
    Scenario: You want to type a capital letter but hold the Shift key down too long while using the arrow keys to navigate.
    Consequence: Instead of moving the cursor, you highlight text line by line. Any subsequent keystroke (like typing a normal letter) immediately deletes that highlighted area.
  3. Cats or pets, etc., on the keyboard
    Scenario: A cat walks across the keyboard, or you accidentally place a book on it.
    Consequence: This often triggers random key combinations that highlight text and overwrite it with the next key pressed.
  4. Wireless keyboard delays (input lag) (according to AI)
    Scenario: Your Bluetooth keyboard or PC stutters for a second. You click the mouse frantically and keep typing.
    Consequence: The clicks are registered after a delay as multiple clicks (causing text to be highlighted), and the subsequent text buffer overwrites the selection.
1 Like

BRAVO pour votre retour riche en informations !!