-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Easier copy-pasting from diffs by making +/- signs unselectable #282
Easier copy-pasting from diffs by making +/- signs unselectable #282
Conversation
position: absolute; | ||
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace !important; | ||
font-size: 12px; | ||
text-indent: -3px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Things have changed since last time, make it:
font-size: 11px;
text-indent: -8px;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a top: 1px;
too. At least on my machine.
There's still a weird problem. Try copy-pasting multiple lines of code from a diff and you'll see that all lines except the first have an extra space at the start of the line. Example:
Notice how the closing brace is indented with one space. |
@sindresorhus From what I've looked at it seems to be a problem with how Chrome handles copying text from |
I don't really know either. // @DrewML Any idea? |
Maybe this is related? When I copy the code pictured below (using @jacobbearden's PR): I get this on my clipboard:
Looks like code outside of (in this case, before) the Here is the result with the extension disabled:
|
Am I the only person seeing that weird copy/paste behavior even with the extension disabled? It doesn't seem to be this PR that's causing it for me. 1 thing to note (and it sounds crazy, but I've gone through it like 10 times) - When I log out of my GitHub account, the issue goes away. When I log back in, it comes back. If I visit this diff with Edit: This is definitely a GitHub bug. Run |
Adding this to .blob-code:not(.is-hovered) .add-line-comment {
display: none !important;
} Someone else want to give it a try locally? |
@DrewML Seems like the issue of blank lines being removed persists though, and a space is being added in place of the Result: td.blob-code.blob-code-addition:before {
content: '+';
}
td.blob-code.blob-code-deletion:before {
content: '-';
} |
What do we want to do with this PR? In my opinion, the issue with collapsing empty spaces is still better than what we have without this today (copying all the +/-). Thoughts @sindresorhus @paulmolluzzo @hkdobrev? |
Sure. Let's merge it. We can open an issue about improving it in the future if we find a way. @jacobbearden Could you fix the merge conflict? |
@sindresorhus Fixed 😄 |
@@ -513,4 +513,22 @@ hidden content area created to increase hover target | |||
|
|||
.btn-mark-unread { | |||
margin-top: 8px; | |||
/* +/- pseudo elements on diffs */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you had a merge conflict resolve problem here.
This feature has been removed from Refined Github since it's implemented by Github itself as announced here However, there are users like myself who use Github Enterprise, which is not updated very frequently. It'd be awesome to have the ability to enable that feature on the preferences page. Neither GHE I'm using supports it nor Refined Github :( |
If you're on an older GHE version, it's easier to just use an older RGH. It's too much trouble to support all GHE versions that most of us can't test. |
Is there a documentation on how to use an older version of RGH? Couldn't find an old enough version in Firefox addons. |
So, I had deleted my fork when cleaning up some extraneous repositories I had, so this is all of the changes from, and requested in #254.
This will close #280 if/when it is merged.