 |
 | [resolved] Undo/redo |  |
 |
 | |  |
 |
 | |  |
Veteran
Joined: 26 Dec 2006 |
Posts: 253 |
Location: Phoenix, AZ |
|
 |
Posted: Mon Aug 13, 2007 2:28 am |
|
 |
 |
 |
 |
Ctrl-C is Copy, not Paste, and the OP is correct that it does not clear the undo stack in other applications. This follows with your amendment about changing the editor content, since a Copy does not change the content.
I have to point out, though, that neither does moving the insertion point change thee editor content, but that, too, clears the undo stack in PhpED. I seem to recall you saying that this behavior would change in a future update. I, for one, can hardly wait... I've lost enough code to this already! (Though nowadays, I've gotten into the sad habit of copying the current code state to a new, empty file prior to undo excursions. This protects me in case I happen to click or press an arrow key at the wrong time, and it lets me back up, copy some code from a past state, and return to where I left off. But I really shouldn't have to do this.)
|
|
 |
 | |  |
Site Admin
Joined: 13 Jul 2003 |
Posts: 8351 |
|
|
 |
Posted: Tue Aug 14, 2007 6:26 am |
|
 |
 |
 |
 |
Right, handling for REDO will be changed. Regarding UNDO, I tried Ctrl-C (Copy) in PhpED and in the other editors and UNDO was not cleared in neither of them. In other words, concerning UNDO stack PhpED works fine. I do not think there is any problem. As of REDO, it's list is cleared when cursor is moved because currently all cursor movement operations are the operations stored in UNDO/REDO lists and therefore they are changing the lists, hence the REDO must be cleared after cursor is moved the same way as it's cleared when the text is edited. To illustrate how it works, let's consider the following operations were done and stored in the UNDO list: A->B->C->D. Now we UNDO C and D, therefore A and B will remain available in UNDO and D and C will be moved to REDO. If at this point we run operation E, the editor has no way to REDO C because C is supposed to be applied after B, not after E or you'll get absolutely wrong content. So the C and D must be removed.
|
_________________ The PHP IDE team
|
 |
 | |  |
 |
 | |  |
 |
 | |  |
 |
 | |  |
 |
 | |  |
Site Admin
Joined: 13 Jul 2003 |
Posts: 8351 |
|
|
 |
Posted: Fri Aug 17, 2007 5:15 am |
|
 |
 |
 |
 |
bobwilliams said:
Quote: | Right. But since simple cursor movement doesn't change the content |
It does change the UNDO list and this fact alone makes it imposisble to keep REDO after cursor is moved.
Quote: | it shouldn't be put on the undo stack |
But it is how the lists are done.
Quote: | This is especially important given that it makes some very common, very useful undo-related operations impossible and can easily cause code loss |
No. It can never cause any code loss.
Also, it does not affect UNDO in any way. What affected is REDO.
Spaceman said:
Quote: | I don't see how this can be marked as resolved |
Probably you don't see difference between fixed and resolved. Latter one means that either the problem is acknowledged and won't be fixed in current version or this is not a problem at all.
Quote: | ctrl+c and cursor movements definitely DO NOT clear the undo history |
Probably you do not see difference between REDO and UNDO.
In PhpED ctrl+c and cursor movements definitely DO NOT clear the UNDO history at all.
Quote: | TopStyle even allows undos after saving |
PhpED keeps undo after saving too.
|
_________________ The PHP IDE team
|
 |
 | |  |
Veteran
Joined: 26 Dec 2006 |
Posts: 253 |
Location: Phoenix, AZ |
|
 |
Posted: Sun Aug 19, 2007 11:57 am |
|
 |
 |
 |
 |
dmitri wrote: | bobwilliams said:
Quote: | Right. But since simple cursor movement doesn't change the content |
It does change the UNDO list and this fact alone makes it imposisble to keep REDO after cursor is moved. |
First of all, don't focus so much on implementation details. From a user perspective, undo and redo use a single list--or at least, that's how they *should* behave. Even at the implementation level, though, most software that I've seen or written has implemented undo/redo with a single event stack - but again, impelmentation details are irrelevant.
As to my comment above, I realize that the undo stack is changed by cursor movements as implemented in PhpED. That's what everyone wants fixed. Cursor movements have zero effect on the content of the file--they only affect the state of the editor working on the file--and therefore should not in any way affect undo/redo.
Quote: | Quote: | it shouldn't be put on the undo stack |
But it is how the lists are done. |
So change it. You make changes in the IDE all the time; why not this one? I have no idea whether it's a big change or a small change, but certainly, it's within the realm of possibility to make modifications to the source code to correct what, IMHO, is a very serious bug. The bigger the change, the longer it will take, but simply stating the obvious (that's "how lists are done") about the IDE's current behavior, and using it to justify its continuing on that way, doesn't help us at all.
Quote: | Quote: | This is especially important given that it makes some very common, very useful undo-related operations impossible and can easily cause code loss |
No. It can never cause any code loss. |
Yes. You're completely wrong on this Dmitri. By having an undo/redo behavior that is different from every other editor out there, the behavior is unpredictable. The undo/redo feature itself won't literlly take consume your code, but its completely non-standard behavior will cause the human relying on it to follow a sequence of steps that causes code loss.
For example, just look at some of the threads where peole have pleaded for you to fix this while telling you that it's causing them to lose code:
should-undo-show-cursor-movements-t2538.html?highlight=undo behavior behaviour
an-issue-with-redo-t3413.html?highlight=undo
Another another way in which undo is broken:
selection-after-undo-t2894.html?highlight=undo
Quote: | Also, it does not affect UNDO in any way. What affected is REDO. |
Huh? Undo and redo are by definition intrinsicly tied together. A user expects that the two commands will always perform exactly the opposite function of each other - no more, no less. If undo changes something, redo should precisely revert the change, and vice versa. So if some mis-feature affects one, it certainly affects the other.
But you're simply diverting the thread with this. The point is, the undo behavior in PhpED is very broken by the fact that mere cursor movements are tracked in undo/redo, and that fact is both extremely annoying and can cause data loss.
Quote: | Spaceman said:
Quote: | ctrl+c and cursor movements definitely DO NOT clear the undo history |
Probably you do not see difference between REDO and UNDO.
In PhpED ctrl+c and cursor movements definitely DO NOT clear the UNDO history at all. |
Again, from a user perspective, undo and redo use a single stack of command events. If you do something that affects your ability to perform either undo or redo, then that command stack has been affected. How you have implemented undo in code is irrelevant; you need to look at this from a user's perspective.
Please reconsider fixing this!
|
|
 |
 | |  |
 |
 | |  |
Site Admin
Joined: 13 Jul 2003 |
Posts: 8351 |
|
|
 |
Posted: Mon Aug 20, 2007 10:19 am |
|
 |
 |
 |
 |
Dear bobwilliams,
Quote: | Yes. You're completely wrong on this Dmitri. By having an undo/redo behavior that is different from every other editor out there, the behavior is unpredictable. The undo/redo feature itself won't literlly take consume your code, but its completely non-standard behavior will cause the human relying on it
to follow a sequence of steps that causes code loss. |
Again, I insist that UNDO is available and you can roll back your code safely. No code loss! And no problmes can ever be caused by the fact that REDO is cleared on the cursor movement.
These posts have no relation, absolutely.
They all are about very different issue caused by implemetation problems in the editor when "Keep trailing spaces" is off and/or "Optimal fill" is on.
Just do not change these two settings and you will never get any problems with UNDO. But it has no relation with REDO availablity after cursor movements that we are discussing in this topic.
Please give a try and make sure you can replicate the "potential" problems you're talking about before post 
|
Last edited by dmitri on Thu Oct 18, 2007 4:32 pm; edited 1 time in total _________________ The PHP IDE team
|
 |
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT - 5 Hours
Page 1 of 2
|
|
|
|  |