mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 13:05:25 -05:00
fixes Issue #1621. Using shift-tab on an empty line caused a crash. Additionally, changed the hard coded value of 4 to the tab size variable it really needs to be.
This commit is contained in:
@@ -1479,8 +1479,8 @@ void TextEditor::EnterCharacter(ImWchar aChar, bool aShift) {
|
||||
SetCursorPosition(Coordinates(coord.mLine, GetCharacterColumn(coord.mLine, cindex + spacesToInsert)));
|
||||
} else {
|
||||
auto spacesToRemove = (cindex % mTabSize);
|
||||
if (spacesToRemove == 0) spacesToRemove = 4;
|
||||
|
||||
if (spacesToRemove == 0) spacesToRemove = mTabSize;
|
||||
spacesToRemove = std::min(spacesToRemove, (int32_t) line.size());
|
||||
for (int j = 0; j < spacesToRemove; j++) {
|
||||
if ((line.begin() + cindex - 1)->mChar == ' ') {
|
||||
line.erase(line.begin() + cindex - 1);
|
||||
|
||||
Reference in New Issue
Block a user