Skip to content
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

Cursor position incorrect with non-European characters #68

Open
pepa65 opened this issue Nov 18, 2015 · 7 comments
Open

Cursor position incorrect with non-European characters #68

pepa65 opened this issue Nov 18, 2015 · 7 comments
Assignees
Labels

Comments

@pepa65
Copy link

pepa65 commented Nov 18, 2015

Hoping this is a bug that will be easy to fix:
When opening this UTF-8 sample file in diakonos and going with the cursor to the end of each line,
the cursor lines up with the end of the displayed characters, except in case of the Thai fonts (line 123-130). There the cursor is displayed way past the end of the characters. This makes it difficult to edit Thai texts.

@pepa65
Copy link
Author

pepa65 commented Nov 18, 2015

This report was for the Ubuntu LTS repo version of diakonos (0.9.0) and I found I couldn't build the latest version due to outdated Ruby (1.9.1). So I tried to install it in Ubuntu 15.10 - it's no longer in the repo (why?) so I installed ruby, cloned the git repo, tried to install curses "sudo gem install curses" but it failed to build 'gem native extention'... (Couldn't find ruby.h, so I installed ruby2.1-dev but it still could make a Makefile, 'probably lack of necessary libraries and/or headers') After installing libncurses5-dev and libtinfo-dev (I think) the curses gem did install, and I could run diakonos.

Loading the UTF-8 demo in diakonos rendered total rubbish...

@Pistos
Copy link
Owner

Pistos commented Nov 18, 2015

@pepa65 Thank you for the detailed bug report, as well as for being thorough. Can you provide a link to an example file with Thai text?

@Pistos Pistos self-assigned this Nov 18, 2015
@Pistos
Copy link
Owner

Pistos commented Nov 18, 2015

I should also mention that Diakonos does not support languages whose characters are different width than normal Roman (English and European) characters.

@pepa65
Copy link
Author

pepa65 commented Nov 18, 2015

Sorry, meant to include this in the report:
http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt
It's just that diakonos renders the whole file well, except that the width of the Thai characters (line 123-130) get in the way. the problem occurs because one character is a consonant, and the vowel gets superimposed in the same space, so the editor thinks there are more characters then are actually rendered.

There must be a way to incorporate this in a future release?? Diakonos seems to have come such a long way since I last evaluated it a number of years ago.

Some editors do this correctly, notably JED. jupp, vim, nano, pico, le and joe. Others have the same problem as diakonos, like dex and e3.

EDIT: dex has now been fixed (July 2017).

@Pistos
Copy link
Owner

Pistos commented Nov 18, 2015

I've confirmed the behaviour you're seeing. However, I regret to report that languages like Thai are not supported by Diakonos at this time. I don't know if this would be easy to fix/add, but I welcome pull requests.

@Pistos Pistos changed the title Cursor position incorrect with Thai text Cursor position incorrect with non-European characters Nov 18, 2015
@Pistos Pistos added the bug label Nov 18, 2015
@pepa65
Copy link
Author

pepa65 commented Dec 6, 2015

I'm not quite up to working on this issue, but the people from dex (similar issue) came up with this:

@pepa65
Copy link
Author

pepa65 commented Jul 21, 2017

The same problem was present in dex https://github.com/tihirvon/dex and reported there as issue 22, and @craigbarnes just found the way to fix it: tihirvon/dex#22 (comment) !!
I expect (hope?) the fix can be as easy for diakonos as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants