Skip to content

Copy/paste issues with diffs #4076

Closed
@silverwind

Description

@silverwind

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/confirmedIssue has been reviewed and confirmed to be present or accepted to be implementedtopic/uiChange the appearance of the Gitea UItype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions