Merge pull request #527 from AttorneyOnline/fix/523

Fix ~~, ~> and <> breaking tick pos
This commit is contained in:
oldmud0 2021-04-20 00:05:41 -05:00 committed by GitHub
commit 445d47c5b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3363,22 +3363,9 @@ void Courtroom::chat_tick()
// Alignment characters // Alignment characters
if (tick_pos < 2) { if (tick_pos < 2) {
if (f_rest.startsWith("~~")) { if (f_rest.startsWith("~~") || f_rest.startsWith("~>") || f_rest.startsWith("<>"))
tick_pos = f_rest.indexOf("~~");
f_rest.remove(tick_pos, 2);
tick_pos += 2; tick_pos += 2;
} }
else if (f_rest.startsWith("~>")) {
tick_pos = f_rest.indexOf("~>");
f_rest.remove(tick_pos, 2);
tick_pos += 2;
}
else if (f_rest.startsWith("<>")) {
tick_pos = f_rest.indexOf("<>");
f_rest.remove(tick_pos, 2);
tick_pos += 2;
}
}
f_rest.remove(0, tick_pos); f_rest.remove(0, tick_pos);
QTextBoundaryFinder tbf(QTextBoundaryFinder::Grapheme, f_rest); QTextBoundaryFinder tbf(QTextBoundaryFinder::Grapheme, f_rest);
QString f_character; QString f_character;