Undo plugin April 07, 2017, 06:10:42 pm Could someone please try this sequence:1) type something (anything really)2) hit ctrl+z3) type something else4) hit ctrl+zWhat do you see?What I would expect is that the text I typed in 3 is removed, but instead nothing happens. And if I click the "redo" icon then the text I removed with the ctrl+z of 2 appears again, removing the text I types in 3.
Re: Undo plugin Reply #1 – April 07, 2017, 06:40:39 pm Behavior seems to depend on how quickly I hit crtl-z but yeah I can reproduce what you said above.There may have been an editor fix to help with this, not sure.When the "latest" 1.5.x editor was released, there was still a myriad of issues open, but instead of fixing them in the 1.5.x branch most were pushed to a new 2.X branch, which of course will force us to change just about every plugin and interaction with the editor. I've been back porting some of the fixes to a 1.X elk branch so we can try that but have mixed feelings about the entire thing. I'm kind of tired of dealing with the editors development, two many things are left broken in ..x releases, and then fixes do become available they are in a version that requires API changes everywhere breaking the core and addons and not fitting well in any release cycles.
Re: Undo plugin Reply #3 – April 25, 2017, 05:19:43 am Quote from: emanuele – April 07, 2017, 06:10:42 pmCould someone please try this sequence:1) type something (anything really)2) hit ctrl+z3) type something else4) hit ctrl+zWhat do you see?What I would expect is that the text I typed in 3 is removed, but instead nothing happens. And if I click the "redo" icon then the text I removed with the ctrl+z of 2 appears again, removing the text I types in 3.Exactly the same happening here with me.
Re: Undo plugin Reply #4 – April 25, 2017, 09:43:35 am I marked them to be removed, now someone just needs to do so.
Re: Undo plugin Reply #5 – April 25, 2017, 05:10:35 pm I'm trying to understand the plugin:https://github.com/samclarke/SCEditor/blob/master/src/plugins/undo.js#L170if I'm not entirely wrong, this means:1) if less than 20 chars added since last stored step, exit,2) if less than 50 chars added since last stored step and the last char is not a space, exit,3) otherwise store the undo stepFunny thing, I'm not able to replicate the isse any more on my localhost.I'll try to update the files here, maybe something was fixed somewhere in the meantime since the last update?
Re: Undo plugin Reply #6 – July 29, 2017, 04:02:11 pm I uploaded here in a version of the plugin I modified. https://github.com/elkarte/Elkarte/issues/2919#issuecomment-318855290Let me know if it works any better.
Re: Undo plugin Reply #7 – July 30, 2017, 01:54:19 pm We need to make a tweak to fix the editor focus messing up the page scroll to a named link on load. I'll comment in the gist in a bit.
Re: Undo plugin Reply #9 – July 30, 2017, 06:23:06 pm On editor init the undo plugin does an editor focus event to get the initial cursor position in the editor. This is not normally a problem unless you have the full editor set in Quick Reply. In that case the focus event will pull the screen down to the editor area (as some browsers feel that is in focus) overriding any #blabla in the url like #new.
Re: Undo plugin Reply #10 – July 31, 2017, 07:17:55 am I made the updates to the file on the site since jumping to wrong area on the page was making me very sad Now lets hope I did not mess up the changes you were trying
Re: Undo plugin Reply #11 – July 31, 2017, 10:10:20 am Now the funny part is I have no idea of the changes you made because everything is minified. xD
Re: Undo plugin Reply #12 – July 31, 2017, 03:56:27 pm The changes I made are left in a comment in the gist of your updates
Re: Undo plugin Reply #13 – July 31, 2017, 05:33:26 pm Ohhh... I learned that github doesn't send notifications for comments on gists... or at least I didn't receive any.
Re: Undo plugin Reply #14 – July 31, 2017, 08:19:06 pm gist can be strange. Anyway the change is simple, it just avoids the editor focus event (needed to get cursor position) when the editor is empty. When empty the cursor is at 0,0