Skip to content
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

Wrong text decoration locations on vscode 1.88.1 #210393

Open
changchanghwang opened this issue Apr 15, 2024 · 9 comments
Open

Wrong text decoration locations on vscode 1.88.1 #210393

changchanghwang opened this issue Apr 15, 2024 · 9 comments
Assignees
Milestone

Comments

@changchanghwang
Copy link

changchanghwang commented Apr 15, 2024

Does this issue occur when all extensions are disabled?: Yes. It related all extensions that use textDecoration.

  • vscode version 1.88.1
image
  • before 1.88
image

In vscode, when setting the textEditorDecoration position to absolute and moving its location, before version 1.88, it used to change within the document, but now it's an issue where it changes within the line.

I can't find change logs for this. is there any change?

  • VS Code Version: 1.88.1
  • OS Version:

Steps to Reproduce:

@changchanghwang changchanghwang changed the title Wrong text decoration locations Wrong text decoration locations on vscode 1.88.1 Apr 15, 2024
@dbaeumer dbaeumer assigned hediet and unassigned dbaeumer Apr 16, 2024
@hediet
Copy link
Member

hediet commented Apr 17, 2024

Can you give an example of how to reproduce?

@changchanghwang
Copy link
Author

changchanghwang commented Apr 17, 2024

um... sorry, i don't understand.exactly you said.. what's mean reproduce... you mean how to reproduce text decorations..?

  • 1.87 version
123.mp4
  • 1.88.1 version
2024-04-17.9.27.11.mov

or code?

  private createWalkMotionDecorator = (
    ranges: vscode.Range[],
    editor: vscode.TextEditor,
    junbaeLocation: Location['junbaeLocation'],
  ) => {
    const timeLeft = this.expiredAt - new Date().getTime();

    if (timeLeft <= 0) {
      this.dispose();
      return;
    }

    const decoration = vscode.window.createTextEditorDecorationType({
      after: {
        contentText: ``,
        margin: '0.5em 0 0 0',
        textDecoration: `none; ${objectToCssString({
          width: '50px',
          height: '50px',
          'background-size': 'contain',
          'background-repeat': 'no-repeat',
          'background-image': `url("${motions[this.combo % motions.length]}")`,
          position: 'absolute',
          /**
           * NOTE: Junbae go out of screen when horizontal scroll
           * If you want to limit position of Junbae, use `%`
           */
          right: '5vw',
          ...junbaeLocation,
          'z-index': 1,
          'pointer-events': 'none',
        })}`,
      },
      rangeBehavior: vscode.DecorationRangeBehavior.ClosedClosed,
    });
    this.walkDecoration?.dispose();
    this.walkDecoration = decoration;
    editor.setDecorations(this.walkDecoration, ranges);
  };

when onDidChangeTextDocument or onDidChangeTextEditorVisibleRanges event occurred, it works.

@hediet hediet added this to the April 2024 milestone Apr 18, 2024
@changchanghwang
Copy link
Author

@hediet Is there anything I can help you with? If you'd like, you can advise me on which code to look into, and I'll take a look at it!

@hediet
Copy link
Member

hediet commented Apr 24, 2024

Can you create a minimal vscode extension that showcases this bug and post the code? That way I can try to reproduce the issue.

@changchanghwang
Copy link
Author

@hediet

You can see code here

and you can download extension file in here

@hediet hediet modified the milestones: April 2024, May 2024 Apr 25, 2024
@changchanghwang
Copy link
Author

@hediet

is there any updates? or anything i can help?

@hediet hediet modified the milestones: May 2024, June 2024 May 27, 2024
@changchanghwang
Copy link
Author

@hediet

I want to know how is this issue going

@changchanghwang
Copy link
Author

@hediet

is this fixing?

@hediet hediet modified the milestones: June 2024, July 2024 Jun 25, 2024
@hediet hediet modified the milestones: July 2024, August 2024 Jul 25, 2024
@changchanghwang
Copy link
Author

plz.. how is it going...? if you wnat to help i can help you..! i just want to know why this issue occurred and how to fix it..

@hediet hediet modified the milestones: August 2024, Backlog Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants