Fixes Fl_Text_Editor Home and End keys in line wrap mode

Pressing Home would go to hard newline character, even in
line wrap mode. It now stops  at the soft newline, as expected.
Same for End which now findes the wrapped line break
instaead of the next '\n' character.
This commit is contained in:
Matthias Melcher 2024-08-04 15:59:40 +02:00
parent 46dd1b33cc
commit 72ee34d1cb

View File

@ -310,10 +310,10 @@ int Fl_Text_Editor::kf_move(int c, Fl_Text_Editor* e) {
Fl::copy("", 0, 0);
switch (c) {
case FL_Home:
e->insert_position(e->buffer()->line_start(e->insert_position()));
e->insert_position(e->line_start(e->insert_position()));
break;
case FL_End:
e->insert_position(e->buffer()->line_end(e->insert_position()));
e->insert_position(e->line_end(e->insert_position(), false));
break;
case FL_Left:
e->move_left();