martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.21k stars 258 forks source link

vis-menu can't handle diatrics/accents #941

Closed jpaulogg closed 3 years ago

jpaulogg commented 3 years ago

Hello, thanks for the great work. I'm from Brasil and I miss diatrics and accents in vis-menu prompt. I have no knowledge of C, so I can't help... Is this a difficult task?

Shugyousha commented 3 years ago

hi!

I have added a commit to a branch that should make vis-menu slightly less broken in regards to UTF-8 handling. You can find it here: https://github.com/Shugyousha/vis/tree/try-to-preserve-codepoints

Let me know if that at least improves things for you! If it does, maybe we can try to get the change merged.

jpaulogg commented 3 years ago

Nice! Thanks for the answer.

Unfortunately, it didn't work. My main need is related to word completion. For example, I can't complete the word "atenção", vis-menu shows only "aten".

Shugyousha commented 3 years ago

Unfortunately, it didn't work. My main need is related to word completion. For example, I can't complete the word "atenção", vis-menu shows only "aten".

This is actually a different issue but it turns out that vis-menu had to be changed anyways. I have added another fix (for vis-complete which is used for word completion) on the same branch that fixes the issue for me. Can you try again?

jpaulogg commented 3 years ago

So the problem was also with the vis-complete script! With your modification now the word completion is working. Thanks a lot!

Your solution defines words by separation of blank characters, right? I preferred to fix the problem using another pattern like '[a-zA-ZçÇãÃ]' for the tr program.

Shugyousha commented 3 years ago

So the problem was also with the vis-complete script! With your modification now the word completion is working. Thanks a lot!

Your solution defines words by separation of blank characters, right? I preferred to fix the problem using another pattern like '[a-zA-ZçÇãÃ]' for the tr program.

If you wanted to do it this way, you would have to add any possible combination of diacritics to the pattern. This would be quite a few and rather error prone. My version has its own issues (it won't work for languages without word spaces for example) but I would argue that it's an acceptable 80/20 solution.

jpaulogg commented 3 years ago

So the problem was also with the vis-complete script! With your modification now the word completion is working. Thanks a lot! Your solution defines words by separation of blank characters, right? I preferred to fix the problem using another pattern like '[a-zA-ZçÇãÃ]' for the tr program.

If you wanted to do it this way, you would have to add any possible combination of diacritics to the pattern. This would be quite a few and rather error prone. My version has its own issues (it won't work for languages without word spaces for example) but I would argue that it's an acceptable 80/20 solution.

That's true. My pattern works for my situation, but using '[:blank:]' is a wider solution.