Selection with search and unicode
See original GitHub issueCombining, surrogate or fullwidth chars in the line and/or the search string lead to weird selection offset problems. Steps to repro:
- insert into demo:
echo -en 'combining: ééé\nfullwidth: ¥¥¥\nsurrogate: 𓂀𓂀𓂀\n'
- search for ‘ééé’, ‘¥¥¥’ and ‘𓂀𓂀𓂀’
The selection is kinda off for all 3 types, it gets even worse if the line contains any of these before their occurence. It seems the renderer and the selection manager do not agree on the chars widths and lengths.
Since I had a similar problem with the linkifier, it might be fixable the same way (#1678).
Issue Analytics
- State:
- Created 5 years ago
- Comments:29 (17 by maintainers)
Top Results From Across the Web
Unihan Database Search Page - Unicode
To select a field to search, use the pop-up menu. Enter the data to search for in the text field, and click on...
Read more >Insert ASCII or Unicode Latin-based symbols and characters
To select a character, click the character, click Select, click the right mouse button in your document where you want the character, and...
Read more >search as unicode angular - typescript - Stack Overflow
Thanks everyone, I managed to solve by doing some tests. I decided to create a function that returns the value handled by regex....
Read more >Unicode Quick Guide - Digital Scholarship Group
The one you want is “Unicode Hex Input”; select that one and choose ... You can search for the character you want by...
Read more >Regex Tutorial - Unicode Characters and Properties
You can find a complete list of all Unicode properties below. ... would be a better choice than the Unicode block \p{InCurrency_Symbols} when...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@JasinYip there’s some discussion about the fix in https://github.com/xtermjs/xterm.js/pull/3236, been a while since I looked and don’t have time atm though.
Ah yepp thats abit hidden in the codebase, the code regarding this is in Buffer.ts and BufferLine.ts, both contain several methods that demostrate how to walk cells, easiest startpoint might be this: https://github.com/xtermjs/xterm.js/blob/e8153d929d6bb4f7012d3f20aa8c74abc335715d/src/common/buffer/Buffer.ts#L480
Not sure if you can directly use this method, you have to take care where your string index origin is (whether col 0 of wrapped or unwrapped lines).