-
Notifications
You must be signed in to change notification settings - Fork 14
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
Arabic isn't properly rendered in Neovim until a newline is inserted #52
Comments
Sorry for replying late. |
v0.8.2 |
I'm running it on arch. Installed mlterm from here https://aur.archlinux.org/packages/mlterm |
I tested plain mlterm(3.9.2) and plain neovim(0.8.2) without any configuration, but I haven't reproduced it yet. |
Nope, still the same. Maybe it's an issue with the font? What font do you use? |
I've noticed that, in addition to inserting a new line, inserting ﻻ re-renders the line properly |
I use "Not Sans Arabic" font to show arabic characters, but I think it doesn't caused by font configuration. |
I don't think the bug is in mlterm.
|
@holytrousers |
have you tried the mlterm-git package ? |
@pro-anon I have reproduced your problem by using the :set arabic option and actually writing the text. Previously i pasted arabic text from yamli.com into vim that's why i wasn't able to reproduce the problem. As a temporary workaround try pressing Control+L in normal mode inside vim, that will refresh the screen and render the ligatures properly (inoremap to refresh every time you switch to normal mode ) |
ps. add |
NB. The trick with prepending a letter before the inserted text works only partially though. Baseline Ligatures work then but the letters at the end of the word don't change their shape. |
I think we have narrowed down the problem, try :
Ligatures and end of word letters render properly. |
@pro-anon : your prompt is styled to align the text to the left side of the screen, that's why when you type arabic text in the shell it displays properly. |
@pro-anon : i think enabling the |
Another issue i have found with arabic script : when using |
Yes, that is exactly what I do |
Thanks very much. |
Can you show an example of a |
I believe that arabic text is not in DejaVu Sans Mono, it looks like some variable width font. I guess you are using cairo which switches automatically to the nearest font with necessary glyphs.
First line is for latin scripts, second line is for japanese and chinese, the rest are for arabic. |
Much better now. Thanks @holytrousers |
Sorry for replying late. |
Thank you for fixing on this, glyphs render properly now ! |
The problem with refreshing positional letters drawing (that has been solved in f8c6b88 ) still persists when using backspace. |
It is difficult for a terminal emulator to determine whether to display text right-aligned or left-aligned appropriately. Changing bidi_mode option manually as follows makes mlterm show text the same as xterm with bicon. |
mlterm simply determines right-aligned or left-aligned by a returned value of fribidi_log2vis() in each line. YFI, if you want to make vim in mlterm work the same as in xterm, execute following commands which stop mlterm from processing BiDi and which stop vim from using BiDi feature of mlterm. |
Are you sure the fix is working? |
Great it works ! |
Yes, unsetting MLTERM and mlcc use_ctl false makes mlterm behave like other terminals. ( :set notermbidi in vim doesn't seem to do anything ) If i understand it correctly, is it then that upon getting the signal from fribidi_log2vis() that there is arabic text, mlterm switches just to the opposite side and not explicitly to the right side? |
It doesn't fix it completely, but it alleviates the problem a bit. I don't think this particular problem is related specifically to arabic script, i have seen these leftovers at other occasions, but arabic glyphs make the problem more pronounced. |
@pro-anon : i use |
Thank you all for your great efforts. We started using NeoVim as our main editor. It was very disappointing to see the lack of support for Arabic or other RTL languages on the existing terminals. Luckly enough, we found mlterm even though they mentioned it in the
Color file using the newmoon color scheme
For the main file we use the following:
The results as you can see Screencast.from.02-24-2024.10.37.11.AM.webmFor the Xft mode like @holytrousers prefers. It wasn't that good with most fonts. Screencast.from.02-24-2024.10.44.54.AM.webmOnce again, thank you for the work and for the fruitful discussion. |
The letters here aren't properly rendered
Only after inserting a new line they get fixed
This issue doesn't happen when typing directly into the terminal
The text was updated successfully, but these errors were encountered: