Fix of a small bug found by MSVC iterator assertions

This commit is contained in:
Matthias Köfferlein 2018-09-02 22:57:01 +02:00 committed by Matthias Koefferlein
parent cb15132029
commit 11d5819c77
1 changed files with 2 additions and 2 deletions

View File

@ -638,8 +638,8 @@ void MacroEditorPage::cursor_position_changed ()
QString t = b.text ().mid (pos, 1);
forward = (t == open_rbracket || t == open_sqbracket || t == open_cbracket);
}
if (e != user_data->elements ().begin () && e[-1].start_offset + e[-1].length >= pos && valid_element (*e)) {
QString t = b.text ().mid (pos - 1, 1);
if (e != user_data->elements ().begin () && e[-1].start_offset + e[-1].length >= pos && valid_element (e[-1])) {
QString t = b.text ().mid (int (pos) - 1, 1);
backward = (t == close_rbracket || t == close_sqbracket || t == close_cbracket);
}