Undoing a headline change does not change focus to the headline.

Bug #1162307 reported by SegundoBob
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
leo-editor
Fix Released
Medium
Edward K. Ream

Bug Description

Undoing a headline change does not change focus to the headline and does not open the headline for editing. Hence, if the undo occurs in a headline far from the current focus whether it is on the screen or off the screen, the operator is left wondering, "What did that undo do? Nothing that I could see."

But undoing a body edit does shift focus to the body where the undo occurs and leaves the body open for editing.

Undoing a headline edit should leave the headline in which the undo occurs open for editing. That is what I would expect based on undoing a body edit.

Note: It would be even better if undoing a body edit first shifted focus to the first body line about to changed, then paused for one second, then undid the edit. This would give the operator a hint about what is undone. Similarly a headline undo should shift focus to the headline, pause for one second, then undo the edit.

Test procedure:
Create a new Leo-Editor file by specifying a non-existent file on the command line that starts Leo-Editor.

Example:
    leomy redo.leo

Ctrl-i (Creates a second node)
Alt-up-arrow (focus to first node)
Ctrl-h (open first node for edit)
word1 (Resulting headline: redo.leoword1)
Alt-down-arrow (focus to second node)
Ctrl-z (Undoes the edit of first node leaving headline redo.leo)
Focus is still on the second node.

Note that the focus is still on the second node. The undo did not move the focus and did not open the first headline for edit.

-------
I use Xubuntu 12.04 (precise)
Kernel 3.2.0-39-generic

Leo Log Window
Leo 4.11 devel, build 5645, 2013-03-30 09:55:35
Python 2.7.3, qt version 4.8.1
linux2

tbnorth (terry-n-brown)
Changed in leo-editor:
status: New → Confirmed
Revision history for this message
Edward K. Ream (edreamleo) wrote : Re: [Bug 1162307] [NEW] Undoing a headline change does not change focus to the headline.

On Sat, Mar 30, 2013 at 1:36 PM, SegundoBob <email address hidden>wrote:

> Public bug reported:
>
> Undoing a headline change does not change focus to the headline and does
> not open the headline for editing

This is actually a worse bug than you are reporting. Alas, I see no real
way to fix it. The problem isn't primarily a focus problem, it is a deep
problem with undo and headlines.

Leo's headline-editing logic is spectacularly fragile and difficult. Every
once in awhile I look at it again. This report may spur me to try again,
but I wouldn't get my hopes up.

Edward

Changed in leo-editor:
assignee: nobody → Edward K. Ream (edreamleo)
importance: Undecided → Medium
status: Confirmed → Fix Released
Revision history for this message
Edward K. Ream (edreamleo) wrote :

> This is actually a worse bug than you are reporting.

No, the hard part of this bug has already been fixed. I'll see whether focus can be restored as well.

Changed in leo-editor:
status: Fix Released → Confirmed
milestone: none → 4.11-b1
Revision history for this message
SegundoBob (bhossley) wrote :

I retested for this bug using revision 5778 using the test procedure I stated in the bug description. The test still fails. I detect no change in behavior relative to this bug. This bug is a focus bug. It will be fixed when focus is changed to the node whose headline change is about to be undone.

Revision history for this message
Edward K. Ream (edreamleo) wrote : Re: [Bug 1162307] Re: Undoing a headline change does not change focus to the headline.

On Tue, May 14, 2013 at 1:49 PM, SegundoBob <email address hidden>wrote:

> I retested for this bug using revision 5778 using the test procedure I
> stated in the bug description. The test still fails. I detect no
> change in behavior relative to this bug. This bug is a focus bug. It
> will be fixed when focus is changed to the node whose headline change is
> about to be undone.
>

Thanks for this update.

EKR

Revision history for this message
Edward K. Ream (edreamleo) wrote :

Fixed in rev 5936

Changed in leo-editor:
status: Confirmed → Fix Released
Revision history for this message
SegundoBob (bhossley) wrote :

Edward,

After retrying the test procedure for this bug stated in my post on 2013-03-30, I think this bug has not been fixed--but you have made good progress toward a fix.

I can't say with certainty, but I think you have introduced a flicker of focus. Now I think the focus goes to the headline where the change is undone, then the change is undone, then focus immediately reverts to the headline that had focus when the ctrl-Z was typed, and this headline is left open for editing (even though it was not open for editing when ctrl-Z was typed).

Rev 5936 does not fix the bug: If the undone header is far from the node with current focus, the user is unlikely to see or guess what was undone.

You probably intended to leave focus on the "undone" header and to leave it open for editing--but you "hit" the previous-focus headline instead.

---------
Kubuntu 12.04
kernel 3.2.0-52-generic

Leo Log Window
Leo 4.11a3, build 5936, 2013-08-26 11:50:08
Python 2.7.3, qt version 4.8.1
linux2
setting leoID from os.getenv('USER'): 'bob05'
load dir: /home/ldi/bzr/LeoLatest/leo/core
global config dir: /home/ldi/bzr/LeoLatest/leo/config
home dir: /home/bob05
reading settings in /home/ldi/bzr/LeoLatest/leo/config/leoSettings.leo
docutils loaded
reading settings in /home/bob05/.leo/myLeoSettings.leo
Found /help
reading settings in /home/ldi/tmp/redo.leo
reading: /home/ldi/tmp/redo.leo

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.