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

Selected text in the textarea is selected in VS Code, too, but not quite #326

Open
VOOM108 opened this issue Sep 7, 2024 · 5 comments
Open
Labels

Comments

@VOOM108
Copy link

VOOM108 commented Sep 7, 2024

Description and repro

It is nice that selected text in the textarea will be selected in VS Code, too. But it seems to be a few lines off. Also, it would be nice, if the selected portion of the text would be instantly in the viewport in VS Code, if that is possible at all.

Browser(s) tried

Arc, Chrome

Editor(s) tried

VS Code

@VOOM108 VOOM108 added the bug label Sep 7, 2024
@fregante
Copy link
Owner

fregante commented Sep 8, 2024

Can you provide a video? The selection works for me

@VOOM108
Copy link
Author

VOOM108 commented Sep 11, 2024

This is the typical offset I get:

Zwischenablagebild (6)

Zwischenablagebild (7)

@fregante
Copy link
Owner

fregante commented Sep 11, 2024

Are you using grammarly?

Please test it on https://ghosttext.fregante.com/troubleshooting

@VOOM108
Copy link
Author

VOOM108 commented Sep 11, 2024

No, that is Language Tool. I turned it off for the test with the troubleshooting-page. The selection has an offset to the top there, too, though less.

@fregante
Copy link
Owner

fregante commented Sep 24, 2024

So, a couple of notes:

  • browser to editor selection is not updated, there's no selectionchange listener
  • editor to browser selection is implemented exclusively for raw textarea elements, and only for one selection (not multiple selections)
  • editor to browser textarea selection works correctly in my tests (VS Code -> Chrome)

I'd say:

  • make sure you're using the official VS Code extension: https://marketplace.visualstudio.com/items?itemName=fregante.ghost-text
  • try with another editor (e.g. Sublime), it's possible that the selection index is being changed by some other editor plugin you have installed
  • what's your OS?
  • what's your editor line break setup? Maybe there's a discrepancy there (CR/LF)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants