-
Notifications
You must be signed in to change notification settings - Fork 3
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
mcview scrolling issues with heavy utf-8 files #2283
Comments
Screenshot - though experiencing the behavior is much more useful |
Note: the bug only happens when word wrapping is enabled (that is, you see 2UnWrap in the button bar), and happens even despite the terminal being wider than the file. |
I'm looking at mc-4.7.0.7. Here the bug is in src/viewer/move.c, mcview_move_up() and mcview_move_down() functions, the view->text_wrap_mode branches. The logic that modifies col (e.g. col += width, col -= width etc.) assume that width and bytelenght are the same notions (because col actually means offset in the file), hence does not handle UTF-8 or CJK (double width) characters correctly.
I don't see what the best solution would be, probably someone more familiar with the utf8/width functions of mc could fix it much faster than me. |
Replying to egmont:
Yes, this is the known issue. At least the #2132 ticket requires such fix. |
|
|
Similar scrolling issues are also reproducible with:
|
Note that the internal Help viewer also suffers from similar (but different) bug: it always jumps by a whole paragraph rather than one visual line. (The help viewer and mcview seem to be a totally different pieces of code.) |
This was fixed in #3250, please close the bug. |
|
Important
This issue was migrated from Trac:
egmont
(@egmontkob)wget http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt
mcview UTF-8-demo.txt
Scroll up and down with the arrow (or pgup/pgdn) keys. Notice that very often a partial line appears on the top row, you have to press the arrow key twice or even more times to actually scroll by one line.
This happens when the topmost line that you're scrolling in or out contains lots of non-ascii characters. More precisely, I believe this occurs exactly when the number of bytes forming the topmost row is bigger than the terminal's width.
Buggy both in 4.7.3 and 4.7.0.7, fully UTF-8 environment.
Note
Original attachments:
egmont
(@egmontkob) onJul 15, 2010 at 13:51 UTC
The text was updated successfully, but these errors were encountered: