fixed an off-by-one error

Wed, 27 Jan 2021 18:55:14 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Wed, 27 Jan 2021 18:55:14 +0200
changeset 187
53f9c7b2c068
parent 186
9330b93d9946
child 188
5fc32e4b2a8c

fixed an off-by-one error

sources/interface.cpp file | annotate | diff | comparison | revisions
--- a/sources/interface.cpp	Wed Jan 27 18:55:03 2021 +0200
+++ b/sources/interface.cpp	Wed Jan 27 18:55:14 2021 +0200
@@ -740,7 +740,7 @@
 		if (m_cursorPosition > 0)
 		{
 			std::string& input = getEditableInput();
-			input.erase(input.begin() + m_cursorPosition);
+			input.erase(input.begin() + m_cursorPosition - 1);
 			m_cursorPosition -= 1;
 			m_needInputRender = true;
 		}

mercurial