nvim-comment-frame
nvim-comment-frame copied to clipboard
Border does not alignment at the end

Can we just wait until 5.3 lua integration so we have unicode support 😂🥲
So if I use nerdfonts icons or emojis in the comment line, it may cause problems?
@CharlesChiuGit I think it will. It's about how lua calculates the length of a string. At the moment, lua version embedded into Neovim does not support unicode. So string length is number of bytes in the string which is invalid for unicode characters except for really small fraction of the letters (everything in ASCII is backward compatible so they work). That's why for English but may now work for most other languages
@s1n7ax Thanks for the explaination! But for some reason it not aligned.

In text:
----------------------------------------------------------------------
-- :treesitter related plugins --
----------------------------------------------------------------------
----------------------------------------------------------------------
-- treesitter related plugins --
----------------------------------------------------------------------
Just elaborating on the issue again. Following is getting the length of the character using Lua vs JavaScript. As you can see, JavaScript counts the characters while lua counts the number of bytes. This is why the frame is not aligning. To fix this I'm going to have to add external dependency to support UTF-8.

I'm considering adding unicode support to the plugin in the future.
Sounds cool! Using unicode does seems like a better solution to this. But might still fail at some some edge cases since encoding is such a huge problem. Thanks for your investigation!