tmux-thumbs icon indicating copy to clipboard operation
tmux-thumbs copied to clipboard

Matched strings get displaced when preceded by multi-byte utf8 chars

Open zenhog opened this issue 2 years ago • 2 comments

Like the title and [screenshot](https://i.imgur.com/Fd2DRbp.png suggests, matched text gets displaced when some multi-byte char(s) is(are) present in the line containg the match. As you can see from the screenshot, the same string is matched on the prompt line and the output line, but only the former is displaced. Here the arrow character at the end of the prompt is multi-byte, perhaps the "unticked box" char as well. Anyways, every time a multi-byte char is present on a line, this happens.

My wild guess would be some computation error in the match index. I've tried looking at the code, but unfortunately, I don't speak rust at all.

Let me know if this would be something that would warrant a fix.

zenhog avatar Dec 12 '22 21:12 zenhog

It is a known issue, without a clear solution. https://github.com/fcsonline/tmux-thumbs/issues/76

fcsonline avatar Dec 13 '22 22:12 fcsonline

One workaround seems to be to actually not render those chars at all in the thumbs pane, that way, the problem doesn't exist, and since those chars are mostly uneeded in the regexps we'd want to match either way, I don't see a problem with that. Maybe as an option.

zenhog avatar Dec 14 '22 01:12 zenhog