Skip to content

Copy/paste issues with diffs #4076

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

Closed
silverwind opened this issue May 29, 2018 · 3 comments · Fixed by #7279
Closed

Copy/paste issues with diffs #4076

silverwind opened this issue May 29, 2018 · 3 comments · Fixed by #7279
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented topic/ui Change the appearance of the Gitea UI type/bug
Milestone

Comments

@silverwind
Copy link
Member

Copying content from a diff like this, I see inconsistent behaviour between browsers.

Firefox copies double newlines:

    claims := jwt.MapClaims{

      "repo": repo.ID,

      "op":   lfsVerb,

-     "exp":  now.Add(5 * time.Minute).Unix(),

+     "exp":  now.Add(setting.LFS.HTTPAuthExpiry).Unix(),

      "nbf":  now.Unix(),

    }

    if user != nil {

Safari copies line numbers:


claims := jwt.MapClaims{
--
269 | 269 | "repo": repo.ID,
270 | 270 | "op":   lfsVerb,
271 |   | -			"exp":  now.Add(5 * time.Minute).Unix(),
  | 271 | +			"exp":  now.Add(setting.LFS.HTTPAuthExpiry).Unix(),
272 | 272 | "nbf":  now.Unix(),
273 | 273 | }
274 | 274 | if user != nil {

Chrome seems alright:

    claims := jwt.MapClaims{
      "repo": repo.ID,
      "op":   lfsVerb,
-     "exp":  now.Add(5 * time.Minute).Unix(),
+     "exp":  now.Add(setting.LFS.HTTPAuthExpiry).Unix(),
      "nbf":  now.Unix(),
    }
    if user != nil {

I will probably attempt a fix later, but feel free to contribute as well.

@lunny lunny added type/bug topic/ui Change the appearance of the Gitea UI labels May 29, 2018
@Larivact
Copy link

For Firefox it can be fixed by replacing the <pre> tags in the <td class="lines-code "> cells with <div style="white-space:pre">.

@silverwind
Copy link
Member Author

Related here: The + and - from a diff should not be copied. It can be done by using CSS pseudo elements with user-select: none.

@stale
Copy link

stale bot commented Mar 24, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Mar 24, 2019
@lunny lunny added issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented and removed issue/stale labels Mar 25, 2019
@lunny lunny added this to the 1.9.0 milestone Jun 23, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented topic/ui Change the appearance of the Gitea UI type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants