diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-11-18 00:01:19 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-11-18 00:01:19 +0100 |
commit | 65fd232e102ff89564d5417771e94bed3d1d31c7 (patch) | |
tree | 5e3a159d94a7cc06f7f1807c9b42f3c7218743c6 /src/Text.cpp | |
parent | 4430b3b0be46f4da389a42cf2e871c05188a159d (diff) |
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
Diffstat (limited to 'src/Text.cpp')
-rw-r--r-- | src/Text.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
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); |