femto icon indicating copy to clipboard operation
femto copied to clipboard

UTF-8 support + background color

Open igor-liferenko opened this issue 7 years ago • 5 comments

Hello,

When I open attached file in "femto" (on debian 9 stretch in gnome-terminal), background is light grey. How to make it really white? (like in the middle of the attached picture) Also, when I move around the file, for example up and down with arrow keys, the lines become garbled as I move and are restored to normal when I keep moving the cursor. One more problem: to move up one line I have to press the up-arrow key twice. Another problem: deleting text causes corruption of existing text further in the line. Another problem: after some random editing of the file, background color in parts of buffer becomes white (as seen in attached picture).

UTF-8-demo.txt screenshot from 2017-04-06 12-22-35

igor-liferenko avatar Apr 06 '17 05:04 igor-liferenko

All of the problems you describe are problems with handling the more complex use of UTF8 characters in Femto. For example simplified Chinese characters are composed of 2x 3byte UTF8 characters. So this confuses the editor which at present assume 1 UTF8 char represent 1 letter.

NOTE that Femto was just an intermediate codebase for FemtoEmacs - the latest is at: https://github.com/hughbarney/Femto-Emacs

Though to be honest I doubt FemtoEmacs will handle the kind of situations you are highlighting with this test file - its a while since I tested with it though.

Please let me know what your interest is in these Editors.

hughbarney avatar Apr 06 '17 18:04 hughbarney

I have checked UTF8.txt against femto and FemtoEmacs. Both handle UTF8 mostly right. There are in some cases issues with going to beginning or end of line OR moving up / down. I will need to look at this at some point as I think I only really handled cursor-left and cursor-right and assumed beginning and end line of line would be fine.

I dont see the problem with the background colours OR the Amharic letters not working at all.

Did you link to ncurses OR ncursesw ? see instructions in README.md (building on Ubuntu and ncursesw, ypu to to have a built version of ncurses that supports wide UTF8 characters).

hughbarney avatar Apr 09 '17 13:04 hughbarney

screenshot at: https://github.com/hughbarney/femto/blob/master/screenshots/femto.jpg

hughbarney avatar Apr 09 '17 13:04 hughbarney

The background issue can be fixed by this patch, or a variation thereof: https://github.com/japanoise/femto/commit/7d0e153b31684471b9273f342cd21373a0b83853

japanoise avatar Aug 21 '18 20:08 japanoise

please do a pull request.

hughbarney avatar Oct 23 '23 22:10 hughbarney