Home / GitHub Page

Control+Z issues in v1.0.214

Hello everyone! new user here! Been using this app for two days and I had a overall good first impression; I think it gets close to my current needs.

Unfortunately I run into a relatively big issue upgrading from v1.0201 to 1.0.214 today

I can’t provide you the Log file, but it is easy to replicate (although hard for me to explain)

NB: code view always on

  1. I start-up the app
  2. I have two or more notes i can switch between
  3. In the very first note i open, after making sure i’m ready to type (blinking cursor), if I UNDO (ctrl+z) nothing happens, as expected…
  4. I switch to another note and, again, make sure i’m in edit mode (blinking cursor)
  5. Press ctrl+z
  6. now every character in the current note is replaced with the ones in the previous note
  • sometimes you even can’t REDO, meaning that you have to revert to a previous saved version of the note (if there is one)
  • Another minor issue is that pressing “Enter” while writing stopped working all of a sudden (not my keyboard’s)…

I guess it is due to the new feature that has just been implemented and that needs to be refined, that is the “code view” mode and the rewriting of the editor component (as stated in the update notes).

As long as these issues are still there I’ll be using v1.0.201.

Recap & other details

  • Version affected: 1.0.214
  • Issue found in both Portable and Installer version
  • OS: Windows (8.1)

I can duplicate this.

In fact if you go to edit an existing note and in the markdown editor press CTRL-Z before actually editing any text, Joplin will replace all the text of that note with the full text of whatever note was displayed prior to picking the note for editing. It’s like the editor’s “note content memory” survives changing to a new note.

Seems editing a note does not stop CTRL-Z going back to previously viewed notes.

Gif attached:

  • Opened Joplin
  • Viewed all the default notes
  • Created a note
  • Edited the note
  • Repeatedly pressed CTRL-Z

The edit was removed then the note text was replaced by the text of each of the notes I had previously viewed until I reached the point where I started Joplin.

Joplin 1.0.214 / Windows 10 Pro x64

Exactly that.
You did a better job than me by posting a GIF :slight_smile:

Thank you for joining this discussion.

The reason this is happening is because Joplin allows the editor (ace editor) to handle the undo/redo functionality. When switching notes in Joplin it does the easy thing which is just to set the content of the note to whatever the new note text is. This means that from the editors perspective there has been an edit and if you ctrl-z it will take you to the previous state of the edit.
The easy fix for this is to clear the editor history while switching notes.
Ideally though we would have a system of undo/redo that stores the history per note, or transcends notes.

edit: I just had a look and it’s not as easy as I thought.

@CalebJohn

Thanks for the information. @anto31ad indicated that this behaviour did not occur in v1.0.201.

Just tried v1.0.201 and can confirm that it did not “undo” through the user’s note viewing history. Of course there’s been a rewrite of the editor since then.

The undo manager is normally reset when a new note is loaded but it looks like it doesn’t work for Ace Editor in this release (it seems to work fine for TinyMCE).