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

Word wrapping changes location #1

Closed
asdofindia opened this issue Dec 9, 2023 · 2 comments
Closed

Word wrapping changes location #1

asdofindia opened this issue Dec 9, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@asdofindia
Copy link

Screenshot_2023-12-09-23-20-20-69_3aea4af51f236e4932235fdada7d1643

https://github.com/yuku/textcomplete/tree/main/packages/textcomplete-textarea is using https://www.npmjs.com/package/textarea-caret which said in the readme that it copies text after the caret too to consider word wrap complication and that's why I tried this.

But I think the issue here is rather about that math.max not detecting that a new line has started because of word wrap.

I suppose if the y coordinate of selection start is higher than y coordinate of space/newline, then we have to assume word has wrapped and probably set x coordinate to extreme left.

@knadh knadh closed this as completed in 2bbceb0 Dec 10, 2023
@knadh
Copy link
Owner

knadh commented Dec 10, 2023

Good spot!

But I think the issue here is rather about that math.max not detecting that a new line has started because of word wrap.

This isn't the case. Automatic word-wrapping is purely a visual artifact and doesn't introduce a "\n" in the value.

@knadh knadh added the bug Something isn't working label Dec 10, 2023
@asdofindia
Copy link
Author

Yes, and that's why it doesn't "detect" it when looking for \n

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants