You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can now resolve merge conflicts in the GitHub UI. Often with merge conflicts, I want to include both the conflicts as it's usually just two list items being placed at the end. Would be nice to have a button that just removed the merge conflict markers.
Above, I would have like to preserve both the items. The red characters are the markers I would like removed.
👍 I would like to have options for choose left, choose right, choose both (left first), choose both (right first) similar to other merge tools. When you click one of these buttons, it would edit appropriately and remove the markers in all cases. What do you think?
P.S. Ideally, we would remember what the initial state was and the buttons would remain active after choosing an action and would allow you to click on the buttons again if you've changed your mind.
@jorgegonzalez I'd start with installing the extension from source, looking into the code and then discuss the UI and UX here first before development and then start with something small and share a branch/PR here to get feedback.
I was thinking of implementing this the way VSCode does, adding a line above each conflict with the options to keep the current or incoming change, or both.
Develop dependency is fine, it doesn’t get bundled. Perhaps however there’s a lighter @types/codemirror package we can rely on
Injecting an unsafe script is probably the only way. You can use JSX to generate the script tag.
When I tried to do this, the injected “buttons” were removed by CodeMirror when I made any changes to the content. Does your method preserve them without having to regenerate them?
Thank you @bfred-it for the quick response
Could you tell me how to generate script tag with JSX?
When I tried to do this, the injected “buttons” were removed by CodeMirror when I made any changes to the content. Does your method preserve them without having to regenerate them?
I use CodeMirror widgets to generate actions and CodeMirror adds these actions for us.
Activity
hkdobrev commentedon Dec 13, 2016
👍 I would like to have options for choose left, choose right, choose both (left first), choose both (right first) similar to other merge tools. When you click one of these buttons, it would edit appropriately and remove the markers in all cases. What do you think?
P.S. Ideally, we would remember what the initial state was and the buttons would remain active after choosing an action and would allow you to click on the buttons again if you've changed your mind.
jacobbearden commentedon Dec 13, 2016
Instead of multiple buttons a drop-down similar to the Watch/Unwatch one could be added.
sindresorhus commentedon Dec 13, 2016
👍 to both ideas.
jorgegonzalez commentedon Oct 25, 2017
I would like to attempt this. Any tips for getting started?
hkdobrev commentedon Oct 25, 2017
@jorgegonzalez I'd start with installing the extension from source, looking into the code and then discuss the UI and UX here first before development and then start with something small and share a branch/PR here to get feedback.
jorgegonzalez commentedon Oct 25, 2017
I was thinking of implementing this the way VSCode does, adding a line above each conflict with the options to keep the current or incoming change, or both.
https://code.visualstudio.com/docs/editor/versioncontrol#_merge-conflicts
sindresorhus commentedon Oct 26, 2017
@jorgegonzalez Yeah, that would be a good way to do it.
IssueHuntBot commentedon Mar 21, 2019
@IssueHunt has funded $60.00 to this issue.
farnabaz commentedon Mar 24, 2019
I would like to attempt this.
farnabaz commentedon Mar 24, 2019
Ok, I found a way to do this, but there are some problems and questions:
CodeMirroras develop dependency? because github useCodeMirrorand features writes in Typescript.CodeMirrorobject insidewindow, is this ok to do this?Because of this issue we can't use
select-domto select elements, I useddocument.querySelectorisConflictHere is quick demo
fregante commentedon Mar 24, 2019
Develop dependency is fine, it doesn’t get bundled. Perhaps however there’s a lighter
@types/codemirrorpackage we can rely onInjecting an unsafe script is probably the only way. You can use JSX to generate the script tag.
When I tried to do this, the injected “buttons” were removed by CodeMirror when I made any changes to the content. Does your method preserve them without having to regenerate them?
Thanks for checking in!
farnabaz commentedon Mar 24, 2019
Thank you @bfred-it for the quick response
Could you tell me how to generate script tag with JSX?
I use CodeMirror widgets to generate actions and CodeMirror adds these actions for us.
fregante commentedon Mar 24, 2019
IssueHuntBot commentedon Mar 28, 2019
@sindresorhus has rewarded $54.00 to @farnabaz. See it on IssueHunt