Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undo (ctrl+z) makes a mess #16

Open
sylviatancheva opened this issue Oct 9, 2014 · 5 comments
Open

Undo (ctrl+z) makes a mess #16

sylviatancheva opened this issue Oct 9, 2014 · 5 comments
Labels

Comments

@sylviatancheva
Copy link

While editing a few lines I pressed ctrl+z few times and all the code went into a huge mess. Seems that undo is buggy.
(Eclipse Version: 4.4.0.v20140925-0400)

@caspark
Copy link
Owner

caspark commented Oct 9, 2014

Ah, that makes sense; I'm not suspending undo at all, which I think other invocations of linked mode editing do.

Thank you for the bug report.

@caspark
Copy link
Owner

caspark commented Nov 9, 2014

@sylviatancheva / @mniewrzal (since you opened #18 and #21 so presumably you've had this problem), are either of you able to provide a consistent set of steps which will lead to things getting into a huge mess?

I tried to reproduce this by selecting all or some occurrences of the text MyThing in the snippet

public class SomeMyThing {
    public void MyThing() {
        MyThing();
        // MyThing();
        System.out.println("MyThing; yep, MyThing");
        /*And sometimes I like MyThing*/
    }
}

but the behaviour I got was pretty reasonable:

  • While editing, hitting undo once will undo a batch of changes across all portions of text being edited.
  • After editing, hitting undo once will undo a change in a single portion of text that was edited. It'd be nice if it kept the same behaviour as during editing, but I don't think this is a big issue (just hold down ctrl+z).

@sylviatancheva
Copy link
Author

I used a very simple php example:

@kaloyan-raev
Copy link
Contributor

@caspark perhaps the issue is more visible on those editor which are based on WTP Source Editing. Try editors like HTML, XML, CSS and PHP.

@caspark
Copy link
Owner

caspark commented Nov 10, 2014

Thanks, confirmed on the PHP editor; I can get some very screwy things to happen.

Experimenting a bit, I determined that this only happens when you already have some undo history;
for example, when I created a php file with the contents echo 1 echo 2, close it (to lose the undo history), reopen it, and start renaming echo to echoq, then ctrl+z doesn't do anything.

But it's also deterministic: if, after freshly opening the file with contents echo 1 echo 2, I change the text to echo 1 echo 2z and start renaming echo to echoq, then when I hit ctrl+z then the text consistently changes to echo1 echo 2z.

Anyway, disabling undo while in linked edit mode is probably the easiest hack to work around this. (I don't think it's really worth investigating how to fix it properly, because any "real" multiple cursor support will need to move away from linked mode editing anyway.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants