From c0fa3a6aaed785b489943f85b1e569020a33a50e Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Thu, 24 Nov 2011 19:27:24 +0100 Subject: [PATCH] Editor no longer moves the cursor if not needed. --- utils/editor.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/utils/editor.cpp b/utils/editor.cpp index ac16bf34..66c325be 100644 --- a/utils/editor.cpp +++ b/utils/editor.cpp @@ -62,9 +62,16 @@ unsigned textmode() bool ctrl = false; + int oldcursorx = -1; + int oldcursory = -1; while ( true ) { - cursorto(cursorx, cursory); + if ( oldcursorx != cursorx || oldcursory != cursory ) + { + cursorto(cursorx, cursory); + oldcursorx = cursorx; + oldcursory = cursory; + } unsigned method = System::Keyboard::POLL; uint32_t codepoint = System::Keyboard::ReceiveKeystroke(method);