Skip to content

Commit

Permalink
Mac OS text input: Fl::compose_state is a number of bytes (not of cha…
Browse files Browse the repository at this point in the history
…racters).

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9757 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
Manolo Gouy authored and Manolo Gouy committed Dec 15, 2012
1 parent 22b4198 commit 05d20db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/Fl_Text_Editor.cxx
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Fl_cocoa.mm
Expand Up @@ -1958,7 +1958,7 @@ - (void)setMarkedText:(id)aString selectedRange:(NSRange)newSelection {
received, newSelection.location, newSelection.length, Fl::e_length, Fl::compose_state, [received length]);*/
Fl_Window *target = [(FLWindow*)[self window] getFl_Window];
Fl::handle(FL_KEYBOARD, target);
Fl::compose_state = [received length];
Fl::compose_state = Fl::e_length;
fl_unlock_function();
}

Expand Down

0 comments on commit 05d20db

Please sign in to comment.