From 72ee34d1cb1b93b8963a41a137ae5daf57e123f8 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sun, 4 Aug 2024 15:59:40 +0200 Subject: 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. --- src/Fl_Text_Editor.cxx | 4 ++-- 1 file changed, 2 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 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(); -- cgit v1.2.3