From 05d20db147c80ff80f03d6674d0ffaeddb1cecd0 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sat, 15 Dec 2012 22:03:55 +0000 Subject: Mac OS text input: Fl::compose_state is a number of bytes (not of characters). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9757 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Text_Editor.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Fl_Text_Editor.cxx') diff --git a/src/Fl_Text_Editor.cxx b/src/Fl_Text_Editor.cxx index 723f2bac7..d13fd7139 100644 --- a/src/Fl_Text_Editor.cxx +++ b/src/Fl_Text_Editor.cxx @@ -514,8 +514,9 @@ int Fl_Text_Editor::handle_key() { int del = 0; if (Fl::compose(del)) { if (del) { - int dp = insert_position(), di = del; - while (di--) dp = buffer()->prev_char_clipped(dp); + // del is a number of bytes + int dp = insert_position() - del; + if ( dp < 0 ) dp = 0; buffer()->select(dp, insert_position()); } kill_selection(this); -- cgit v1.2.3