-
-
Notifications
You must be signed in to change notification settings - Fork 245
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
Synchronize scrolling in the web version #8
Comments
Hello pravic, thank you! I think it is hard to scroll both. Sometimes the transformed code is more than the original one. For example, if you play with templates and instantiate a lot of them the right side has way more content than the left. If you know a way to do that I welcome a PR. Initially I had such a diff view in mind. I still do. Its just that my web development skills are, well low. CodeMirror does offer a diff plugin, so it is possible I think. PRs welcome applies here as well :-) |
That's the point :) It's called "Synchronized scrolling", a very popular feature in some code editors and in almost all diff viewers. But yes, I think it is related to the diff feature itself which might be implemented in some JS component already. Who knows. |
@andreasfertig Can I pick this up? |
Hello @nishanthkarthik, that would be great! Andreas |
@andreasfertig The merge view supports what we need. However, both editor instances are tied to a single Is this behavior okay?
The alternative is to leave the highlighted lines on all the time, but I don't think that would be an intuitive experience. As the user modifies the left pane after compiling, both views are not in sync and a diff is no longer necessary. What do you think? |
Hello @nishanthkarthik, your approach sounds good to me. Don't worry about the On thought, it maybe nice, if a user can turn the diff view off. Andreas |
I'm using
Do you think we can go ahead with this trade-off or switch to a different diff view? |
The merge view leaves a lot to be desired. It internally uses diff-match-patch |
Hello @nishanthkarthik, thanks for your work. I think it looks ok. Another interesting case is something like this:
There we have an inline diff. Andreas |
Changing color is purely CSS. I think that should be okay. I'll try out the large examples and post screenshots here. I am also gonna try using monaco's diff view without using npm. The diff view will be similar to VS Code. |
Hello, this issue has been open for quite a while now. I still believe that the diff is not easy to compare. I'll close the issue in a couple of days if nobody objects and shows some progress. Andreas |
Hello,
First of all, thanks for this interesting and very useful tool. It will be really helpful for newcomers and those who want to refresh his knowledge of modern C++ standards.
Just a suggestion of a tiny UX improvement: it'd be nice to synchronize code output in the web page when scrolling. Right now you have to scroll both panels manually to compare output side by side.
Optionally, may be something similar to diff view with slightly colored lines (of course, a full diff highlighting, like in github, isn't needed).
The text was updated successfully, but these errors were encountered: