Bug 44062 - EDITING: Autocorrect can't be undone immediately after inserting a new line
Summary: EDITING: Autocorrect can't be undone immediately after inserting a new line
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.4.4 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
: 70520 90645 107734 (view as bug list)
Depends on:
Blocks: Undo-Redo Hyperlink
  Show dependency treegraph
 
Reported: 2011-12-22 07:51 UTC by patheticcockroach
Modified: 2023-06-14 14:46 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Screencast showing the bug in LibreOffice 5.1.3 (OpenSUSE) (78.69 KB, video/webm)
2016-10-04 07:43 UTC, Ulrich Windl
Details
Screencast - Autoformatting of URL after inserting a new line can be undone without removing the new line. 'AutoFormat' is LO's first undo step, 'New Paragraph' is second (870.52 KB, video/x-matroska)
2020-06-07 09:51 UTC, Mike
Details

Note You need to log in before you can comment on or make changes to this bug.
Description patheticcockroach 2011-12-22 07:51:46 UTC
Problem description: Certain modifications realized automatically by auto-correct, such as URL recognition, can't be undone, if they were triggered by inserting a new line, without first undoing the new line.

Steps to reproduce:
1. Make sure you have auto-correct and URL recognition on
2. Type a URL
3. Hit return
4. Undo (CTRL+Z)

Current behavior: the new line is removed but the auto URL formatting stays.

Expected behavior: the opposite, ie the auto URL formatting is removed but the new line stays. That's the behavior, for instance, if you replace "return" by "space" in the steps to reproduce.

Platform (if different from the browser): Win 7 x64
              
Browser: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
Comment 1 sasha.libreoffice 2012-05-02 07:55:32 UTC
Thanks for new idea
described behaviour reproduced in 3.5.3. It may be improved. Users may expect that if auto-correction happens, it may be immediately removed by Ctrl-Z.

What is interesting: in msOffice 2007 auto-correction removes first by Ctrl-Z, then removes new line.
Comment 2 patheticcockroach 2012-05-02 08:13:23 UTC
(In reply to comment #1)
> described behaviour reproduced in 3.5.3. It may be improved. Users may expect
> that if auto-correction happens, it may be immediately removed by Ctrl-Z.
Actually, for other kinds of auto-correction, it seems to work in that order. For instance if you type a list like this:
- item 1(return)
(CTRL+Z)- item 2
then you'll get to keep your line break.

Another example: if you reproduce this bug's steps but instead of a line break (step 3) type a space, then CTRL+Z removes the URL auto-detection first.
Comment 3 Buovjaga 2016-09-28 14:19:24 UTC
*** Bug 70520 has been marked as a duplicate of this bug. ***
Comment 4 Ulrich Windl 2016-10-04 07:43:11 UTC
Created attachment 127798 [details]
Screencast showing the bug in LibreOffice 5.1.3 (OpenSUSE)

I was asked to re-check the bug 90645 (which transitively became a duplicate of this bug): The problem wasn't fixed by hoping and waiting ;-)
Comment 5 Yousuf Philips (jay) (retired) 2017-05-10 04:26:15 UTC
*** Bug 107734 has been marked as a duplicate of this bug. ***
Comment 6 Yousuf Philips (jay) (retired) 2017-05-10 04:28:17 UTC
From my duplicate bug.

Steps:
1) Open Writer
2) Type 'http://libreoffice.org/'
3) Press spacebar
4) Check undo list and there will be an entry for 'Typing: " "' and 'AutoCorrect'
5) Press undo to remove the auto hyperlinking of the text
6) Press undo a second time to remove the space
7) Press enter
8) Check undo list and there will be 2 entries for 'Apply attributes' and 1 entry for 'New Paragraph'
9) Press undo once will not remove auto hyperlinking as 'New paragraph' is the first undo in the list

So the workaround is to press spacebar, undo, then enter, then remove the space from the previous row.

Version: 5.4.0.0.alpha0+
Build ID: 74ccd02eda2d6325a27266fd935aba29b3d75020
CPU threads: 2; OS: Linux 4.4; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2017-04-27_23:51:14
Locale: en-US (en_US.UTF-8); Calc: group

@Maxim: Would it be simple to move the 'New Paragraph' undo entry before the 'Apply attributes' and any idea why 'Apply attributes' is appearing rather than 'AutoCorrect'?
Comment 7 Xisco Faulí 2017-10-28 18:23:11 UTC
*** Bug 90645 has been marked as a duplicate of this bug. ***
Comment 8 Mike 2020-06-07 09:51:23 UTC
Created attachment 161715 [details]
Screencast - Autoformatting of URL after inserting a new line can be undone without removing the new line. 'AutoFormat' is LO's first undo step, 'New Paragraph' is second
Comment 9 Mike 2020-06-07 09:51:50 UTC
I can repoduce it in 
Version: 6.1.0.3
Build ID: efb621ed25068d70781dc026f7e9c5187a4decd1
CPU threads: 4; OS: Windows 10.0; UI render: GL; 
Locale: de-DE (de_DE); Calc: CL

but not in
Version: 6.2.2.2
Build ID: 2b840030fec2aae0fd2658d8d4f9548af4e3518d
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
Locale: de-DE (de_DE); UI-Language: en-US
Calc: CL

Yousuf's step 8 was
>8) Check undo list and there will be 2 entries for 'Apply attributes' and 1 entry for 'New Paragraph'

In 6.1 there are those two 'Apply attributes' steps, but in 6.2 they are replaced by one 'AutoFormat' entry.

I can undo the autoformatting of URLs directly after inserting a new line without removing the new line.
If I start Writer LO7B1, type a URL and press Enter, a new line is inserted and the URL autoformats. But when I undo it, first undo step is 'AutoFormat' and second undo step is 'New Paragraph'. 


I attach a screencast.

Version: 7.0.0.0.beta1 (x64)
Build ID: 94f789cbb33335b4a511c319542c7bdc31ff3b3c
CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: en-US (de_DE); UI: en-US
Calc: threaded
Comment 10 patheticcockroach 2020-06-07 09:56:41 UTC
Working fine for me too in 6.4.3.2. Looks like someone fixed it and forgot to take credit ;)