Cudatext: Undo/Redo animation fixing

Created on 26 Mar 2021  路  49Comments  路  Source: Alexey-T/CudaText

made new topic. to discuss 'minimal animation' on undo/redo. how it works: if undo must jump to not-yet-visible area, it jumps and shows 'current line highlight' and makes a pause.
so if we have 3 changes on lines 20, 200, 300, we have 3 pauses.

new beta at
http://uvviewsoft.com/c/
@xcme @halfbrained

bug

All 49 comments

When this works it is very helpful...

But now if I make several (~4) changes throughout the document, then holding Ctrl+Z to undo everything - some changed lines will not be reverted. ~100% reliable.

And occasionally while playing with Undo/Redo I get to the state where trying to one of the Undo/Redo will give "Access Violation" popup every time. (might be related to me moving caret with mouse or PageUp/PageDown while doing Undo/Redo :) )

err

then holding Ctrl+Z to undo everything - some changed lines will not be reverted. ~100% reliable.

ah, it is App.ProcessMessages call, which breaks it. working on it.

made new beta.
now during undo/redo (if undo pause>0) I do 'enabled= false' for control. it gives gray BG color. IMO it's ok.
crash solved?

All is well now, no crashes. Thanks

made new topic. to discuss 'minimal animation' on undo/redo. how it works: if undo must jump to not-yet-visible area, it jumps and shows 'current line highlight' and makes a pause.

Right

so if we have 3 changes on lines 20, 200, 300, we have 3 pauses.

Not quite. It should make a pause every jump, not every line. In that cause we have 2 pauses: between 20 and 200 and then between 200 and 300. And there shouldn't be any delay between 300 and 303, for example.

If if really does pause for each line it could explain why I got this case (3rd entry).

In that cause we have 2 pauses: between 20 and 200 and then between 200 and 300. And there shouldn't be any delay between 300 and 303, for example.

yes, it must work like this already.

it's already so: pause is running only on screen-scrolling-jump.

But how can I get issue with delay on each line?
Will try to reproduce...

@xcme if you are Ru-speaking welcome to Discord chat
https://discord.gg/z7JcRN3e
invite will end after 1 day.

Yes, I'm. I use English just to make sure other people can participate and google some issues once. And for practice purpose.
But I don't have Discord yet. Perhaphs I will register it a bit later.

But how can I get issue with delay on each line?

maybe you __hold__ ctrl+z for seconds?

I will show one demo with similar problem within 10 minutes.

blinking_and_delay_in_visible_area.zip
As you can see it uses delay and blinks even in visible area.

yes, special case at end-of-file! thanks. made a fix,
beta updated.

Ok, will check soon!

Now it works for undo but blinks for redo. Another issue for redo - #3269. Seems, similar root cause.

  • Try any symbol + enter for 5-7 times in a new file.
  • Then several times undo
  • Then several times redo

You will see as it blinks on redo.

But it you perform changes not at the end of file it seems it works as it should.

animation_bug.zip
Another animation bug. I posted it here because this issue is for animation.

You will see as it blinks on redo.

thanks, seems fixed now. beta updated.

animation_bug.zip

I dont get what is hapening here. seems you run Undo and it undoes line by line, and when it reaches first non-shown line it does animation? then it's ok. you Undo 40 typed lines and after some N lines you must see animation (caret out of view)

I dont get what is hapening here.

No, I pressed undo hotkey once and it caused this chain reaction. The same then for redo - only one time also.

is this reaction in the new beta too? (my previous comment)

Sorry, will test it tomorrow.

I updated beta just now- more minor fixes. @xcme

You will see as it blinks on redo.

Seems fixed

I see that 'chain reaction of pauses' is fixed (still same beta)

Seems fixed

Minor issue/question:

  • I think CT considers the area as visible area based on caret position, but what if we just scroll the window a bit? From CT's point of view it's still visible, but from user's isn't

Nope, CT considers it ignoring the caret position

OK, you are right.
Try to test next animation issue then:

  1. Type something in line 100
  2. Scroll screen to line 1 (to hide line 100 from the screen)
  3. Perform undo

In my case I see _blink_ but don't see the change itself on the line 100.

thanks, will work on it.

seems fixed. new beta-- pls test?

Yes, looks like that!

In #3271 I can see chain reaction again:

  1. Set "wrap_mode" to 1
  2. Open new tab
  3. Press Enter 4 times
  4. Perform undo, then redo

You will see "chain reaction" with blinking and delay between each line.

Good thing is: i know what to fix.

beta updated.
note: sometimes I see the 'animation' on redo at end-of-file if "last_line_on_top" + "wrapped". hard to fix it and it's minor

Last beta, clean installation, no settings at all:

  1. New tab
  2. 100 empty lines (via Enter)
  3. Undo
  4. Redo

Now this animation is present for both undo and redo. And it removes all 100 lines. As far I understand, if the final position is the line 1, then it should jump to the line 1, wait once and then perform undo.

yes, confirm,it is that hard case which is not 100% OK. during 100 lines undo-redo I see it, hard to fix yet, I tried
but it is not slowing the work.
EDIT
maybe I'll keep it as is.

but it is not slowing the work.

That the point, it is. It's also almost the first issue I saw after launching beta, so all new users will see it. Please, take your time, don't hurry. You may find a solution or workaround next days :)

fixed anothere 'chain reaction of pauses'. beta updated.

  • big file
  • Ctrl+A, Del
  • Undo

I see, now it's fixed for redo, but for undo issue is still there. But it's a progress!

I think I must do a pause only when at least 1-2sec was passed since last pause.

As a workaround? Could you describe what the problem with this case?

  • do Enter 100 times
  • Undo: each undo step (1 line) goes 1 line upper-- lot of pauses appear

that is a problem.

Placed new beta. now I'm not use I fixed all cases, lets see

* Undo: each undo step (1 line) goes 1 line upper-- lot of pauses appear

As I said before "if the final position is the line 1, then it should jump to the line 1, wait once and then perform undo." The initial request implies one undo = one jump:

I propose just to change sequence:
jump to the right line
wait for very short period
undo/redo in the visible area
jump to the right position

P.S. Will check the beta

Now I see only one jump in that case and it very quickly. Don't see problems now, but let me check it tomorrow also.

of course, let's test it for N days.

The only small issue - it performs redo a bit long sometimes. It looks like there are 2 or 3 pauses instead of 1. But in other tab I can't reproduce.
long_redo.zip

@Alexey-T did you watch the last demo?

yes I did, but I don't understand it, and no repro....

Will try to reproduce again...

let's post it later to a new issue. this is overheated. closing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Alexey-T picture Alexey-T  路  5Comments

Alexey-T picture Alexey-T  路  3Comments

JairoMartinezA picture JairoMartinezA  路  7Comments

charliewales picture charliewales  路  4Comments

JairoMartinezA picture JairoMartinezA  路  5Comments