mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-04-19 08:58:56 +00:00
TextEditor: fix deletion of a tab character.
- when deleting a tab, cursor should move by tab size
This commit is contained in:
parent
8dea28a6e8
commit
2bc7efa4db
1 changed files with 10 additions and 2 deletions
|
@ -2186,8 +2186,16 @@ void TextEditor::Backspace()
|
|||
// --cindex;
|
||||
|
||||
u.mRemovedStart = u.mRemovedEnd = GetActualCursorCoordinates();
|
||||
--u.mRemovedStart.mColumn;
|
||||
--mState.mCursorPosition.mColumn;
|
||||
if (line[cindex].mChar == '\t')
|
||||
{
|
||||
u.mRemovedStart.mColumn -= mTabSize;
|
||||
mState.mCursorPosition.mColumn -= mTabSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
--u.mRemovedStart.mColumn;
|
||||
--mState.mCursorPosition.mColumn;
|
||||
}
|
||||
|
||||
while (cindex < line.size() && cend-- > cindex)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue