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 extraction sometimes missing spaces #982

Closed
christianparpart opened this issue Jan 13, 2023 · 6 comments · Fixed by #989
Closed

Selected text extraction sometimes missing spaces #982

christianparpart opened this issue Jan 13, 2023 · 6 comments · Fixed by #989
Labels
blocker:office Bug reported by my colleges, and hence should be fixed ASAP. :) bug Something isn't working VT: Backend Virtual Terminal Backend (libterminal API)

Comments

@christianparpart
Copy link
Member

Quote from @cqexbesd,

I just copied (by selecting with my mouse) some text and
when I pasted there are spaces missing (but not all of them).

If I copy the same text front he same window it is always reproduceable
but the same text in a different window is fine

in all cases the text I am copying is from nvim

I guess these spaces got lost on wrapped lines and it's the spaces at the wrapping point?

@christianparpart christianparpart added bug Something isn't working VT: Backend Virtual Terminal Backend (libterminal API) blocker:office Bug reported by my colleges, and hence should be fixed ASAP. :) labels Jan 13, 2023
@whisperity
Copy link
Member

Also if your highlight contains tabs, then the highlight messes up when dragging around the tab.

Try:

echo -e "Free memory:\t130 GiB"

@cqexbesd
Copy link
Contributor

I guess these spaces got lost on wrapped lines and it's the spaces at the wrapping point?

There should have been no wrapping involved. Both windows were wide enough to accommodate the lines.

@christianparpart
Copy link
Member Author

I will check.

@cqexbesd
Copy link
Contributor

then the highlight messes up when dragging around the tab.

Do you mean that if you select from the left to the right, the moment you get to the tab it highlights the rest of the line (and sometimes a bit of the next line under circumstances I can't identify) but then goes back to normal when you get to the word after the tab? If so I can reproduce that as well but its a different issue to the one I was reporting. In my case the right thing is highlighted, it's just not what ends up on the clipboard.

@cqexbesd
Copy link
Contributor

Ah but you are right - copying and pasting something with a tab loses the tab, just like my bug loses the spaces. So that's probably a good test case as I imagine the cause is the same.

printf "a\tb\n" and copy and paste that, using mouse or vi mode, and the tab is lost.

@Utkarsh-khambra
Copy link
Collaborator

Also if your highlight contains tabs, then the highlight messes up when dragging around the tab.

This comes from here that I added in #751. Fix for it is simple, I just need to also check for tab character as well.
Btw are there any other types of spaces other than a space and tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker:office Bug reported by my colleges, and hence should be fixed ASAP. :) bug Something isn't working VT: Backend Virtual Terminal Backend (libterminal API)
Projects
None yet
4 participants