From 65fd232e102ff89564d5417771e94bed3d1d31c7 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 18 Nov 2021 00:01:19 +0100 Subject: Fix window not being visible on kde because color map is deleted while the window is in use, text editing not working for the first character --- src/Text.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/Text.cpp') diff --git a/src/Text.cpp b/src/Text.cpp index 39e5bbd..18a87f4 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -1013,9 +1013,7 @@ namespace QuickMedia str += '\n'; } else { const size_t str_index = get_string_index_from_caret_index(caretIndex); - if(str_index > 0) { - str.insert(str_index, 1, '\n'); - } + str.insert(str_index, 1, '\n'); } ++caretIndex; @@ -1044,9 +1042,7 @@ namespace QuickMedia str += stringToAdd; } else { const size_t str_index = get_string_index_from_caret_index(caretIndex); - if(str_index > 0 && str_index != std::string::npos) { - str.insert(str_index, stringToAdd); - } + str.insert(str_index, stringToAdd); } caretIndex += utf8_get_length(stringToAdd); -- cgit v1.2.3