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

Less history entry when changing color #22

Open
ArkadiuszMichalski opened this issue Sep 9, 2015 · 5 comments
Open

Less history entry when changing color #22

ArkadiuszMichalski opened this issue Sep 9, 2015 · 5 comments

Comments

@ArkadiuszMichalski
Copy link

Is there any way to shut down CM history modyfication when changing color by Inlet? Now is really hard backing to starting (original) value, because all actions (new color) is remember by CM and after setting new value we must press many times "Ctrl+Z" < undo.

Will be better if Inlet will return new color value (last) to CM only when we close slider and output actual changing value (text) to somwhere in slider.

@georules
Copy link
Contributor

georules commented Sep 9, 2015

This is a good point since it seems that codemirror seems to keep a pretty small history. I tried to mockup this functionality for changing hex colors, getting the history on a hex match and restoring the history to that point when there is another click into the editor. It has some problems though:

  1. it does not include the original value of the hex color before you pick a new one
  2. if you press control z before restoring (getting focus back into the editor) control z will go back in the history of colors
  3. clicking to remove the thistle color picker does not restore focus to codemirror, and then requires another click in the editor before the history is restored.

In case anyone is interested in tackling this or has ideas, here is my attempt as perhaps a starting place:

storing history: georules@53537ea#diff-f3d2729ea93f0b72d03a02dd99adf6c9R177

reverting history: georules@53537ea#diff-f3d2729ea93f0b72d03a02dd99adf6c9L234

https://github.com/georules/Inlet/tree/history
https://codemirror.net/doc/manual.html#api_history

@enjalot
Copy link
Owner

enjalot commented Sep 11, 2015

We want to change the actual text in CodeMirror on every color choice so that we see it render as we change. The immediate feedback is a key feature.

I do agree that having a way to "undo" your playing around would be a useful feature. I don't know that restoring when you click in the editor is good because thats one of the main ways to close the editor, what if you want to keep the color?

@georules
Copy link
Contributor

It's restoring the history before the color-scrubbing, not the text presently in the editor. The text would stay as you selected it, but not have the history of the many color selections you made along the way, so undo is closer to points where you actually typed. (at least I think this is what was being requested)

@enjalot
Copy link
Owner

enjalot commented Sep 11, 2015

oooh, so by manipulating the history you're still making the changes with
each selection, but when you are done you can easily undo to the previous
value. 👍

On Fri, Sep 11, 2015 at 2:14 PM, Geoffery Miller notifications@github.com
wrote:

It's restoring the history before the color-scrubbing, not the text. The
text would stay as you selected it, but not have the history of the many
color selections you made along the way, so undo is closer to points where
you actually typed. (at least I think this is what was being requested)


Reply to this email directly or view it on GitHub
#22 (comment).

Ian Johnson - 周彦
http://enja.org

@georules
Copy link
Contributor

Yeah I think to implement this we'd need to at least fix:

  1. have the next control-z after scrubbing be the color be before scrubbing
  2. restore history on scrubber blur rather than editor refocus

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

No branches or pull requests

3 participants