Ticket #2631 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

[patch ready] mcedit puts cursor in the middle of multibyte utf8 character

Reported by: sergem Owned by:
Priority: major Milestone:
Component: mcedit Version: 4.7.5.5
Keywords: Cc:
Blocked By: #2372 Blocking:
Branch state: no branch Votes for changeset:

Description

Sometimes when editing an UTF-8 file mcedit puts cursor in the middle of the multibyte utf8 character. And when it does, typing a new character results in an invalid utf8 sequence.

I've made some general purpose utf8test file and attached it. To reproduce this bug:

  1. Open this file in mcedit
  2. Put cursor to the end of "Combination of 2bchar + incorrect chars" line
  3. Press "Left" 5 times (notice, cursor moves 2 characters at a time)
  4. Press "q"

And you'd get a broken character.

PS: This bug is related to #2372 and #1730 but different from them.

Attachments

testutf8.txt (3.4 KB) - added by sergem 7 years ago.
mc-4.7.5.5-utf8navigation.patch (3.9 KB) - added by sergem 7 years ago.
this patch should fix the problem

Change History

Changed 7 years ago by sergem

comment:1 Changed 7 years ago by angel_il

fixed in #2372

Last edited 7 years ago by andrew_b (previous) (diff)

comment:2 Changed 7 years ago by andrew_b

  • Blocked By 2372 added

Changed 7 years ago by sergem

this patch should fix the problem

comment:3 Changed 7 years ago by angel_il

  • Status changed from new to closed
  • Resolution set to fixed

see: #2372

comment:4 Changed 7 years ago by andrew_b

  • Milestone Future Releases deleted
Note: See TracTickets for help on using tickets.