summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2024-08-04 15:59:40 +0200
committerMatthias Melcher <github@matthiasm.com>2024-08-04 15:59:44 +0200
commit72ee34d1cb1b93b8963a41a137ae5daf57e123f8 (patch)
treeb1247907f34f55f0a4645bff0eece2c6a28c626c
parent46dd1b33ccb1e34be0b7a6d41a162e4dd611a548 (diff)
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.
-rw-r--r--src/Fl_Text_Editor.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Fl_Text_Editor.cxx b/src/Fl_Text_Editor.cxx
index 55da11cb8..9fe2b5b01 100644
--- a/src/Fl_Text_Editor.cxx
+++ b/src/Fl_Text_Editor.cxx
@@ -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();