Fix caret position after using autocomplete helper

This commit is contained in:
Eduard Kuzmenko 2022-01-20 21:00:09 +04:00
parent a312508364
commit 8343256473

View File

@ -538,7 +538,9 @@ namespace RichTextProcessor {
// * check whether text was sliced // * check whether text was sliced
// TODO: consider about moving it to other function // TODO: consider about moving it to other function
if(entity.offset >= textLength) { if(entity.offset >= textLength) {
continue; if(entity._ !== 'messageEntityCaret') { // * can set caret to the end
continue;
}
} else if((entity.offset + entity.length) > textLength) { } else if((entity.offset + entity.length) > textLength) {
entity = copy(entity); entity = copy(entity);
entity.length = entity.offset + entity.length - textLength; entity.length = entity.offset + entity.length - textLength;