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

[Windows] CTRL+Z clears a node's contents #37

Open
renaudbedard opened this issue Aug 22, 2016 · 1 comment
Open

[Windows] CTRL+Z clears a node's contents #37

renaudbedard opened this issue Aug 22, 2016 · 1 comment
Labels

Comments

@renaudbedard
Copy link

renaudbedard commented Aug 22, 2016

Test case :

  • Create a node, add content
  • Exit node
  • Double-click on that same node
  • Hit CTRL-Z
  • Node text disappears, and that operation can't be undone

Before hitting CTRL+Z

image

After hitting CTRL+Z

image

@rickdoesdev
Copy link
Contributor

rickdoesdev commented Jun 28, 2017

This 'clear' action on ctrl + z still happens, but at least on 0.2.1 ctrl + y puts the text back.

From what I can tell in the debugger the bit that's causing this to happen is ace.js undoChanges function. It calculates a delta of changes and if I understand it correctly, the act of loading a node into the ace editor causes a delta state of "it was empty, then I had a bunch of text". The wierd set of tabs and spaces you get are the result of the tabs inside the index.html <div class="editor" id="editor" .... >{tab and spaces}</div> which ace considers the initial state to fall back to. If you remove those spaces, or populate the empty space with your own text, you can see that when the undo delta triggers you get whatver was between the open and closing tags.

That's great, that's the problem identified.

I have no idea how ace works though, so I'm not sure how to fix this. Does anyone have any suggestions on how we could interrupt the ace undo method if we're at the first local change which was "load node text into editor" ? I though the ctrl+z stuff in app.js updateHighlights may have been what was supposed to be doing this, but it seems that block of code is never actually called, at least that I've seen as yet.

@addie-lombardo addie-lombardo added this to the Spring Cleaning 2018 milestone Jun 12, 2018
@addie-lombardo addie-lombardo removed this from the Spring Cleaning 2018 milestone Jun 13, 2018
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