From e7ac0926a75573ed154a57778f8ec7a2277159f9 Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Sat, 30 Jul 2011 23:06:09 +0000 Subject: [PATCH] Replace console prefix-search behaviour with more standard history navigation, based on patch by Ross Bearman. Fixes #906. This was SVN commit r9939. --- source/ps/CConsole.cpp | 65 +++++++++--------------------------------- 1 file changed, 13 insertions(+), 52 deletions(-) diff --git a/source/ps/CConsole.cpp b/source/ps/CConsole.cpp index 2095339f71..3e6ef200da 100644 --- a/source/ps/CConsole.cpp +++ b/source/ps/CConsole.cpp @@ -406,67 +406,28 @@ void CConsole::InsertChar(const int szChar, const wchar_t cooked ) // BEGIN: Buffer History Lookup case SDLK_UP: - if ( m_deqBufHistory.size() ) + if (m_deqBufHistory.size() && iHistoryPos != (int)m_deqBufHistory.size() - 1) { - int oldHistoryPos = iHistoryPos; - while( iHistoryPos != (int)m_deqBufHistory.size() - 1) - { - iHistoryPos++; - std::wstring& histString = m_deqBufHistory.at(iHistoryPos); - if((int)histString.length() >= m_iBufferPos) - { - bool bad = false; - for(int i=0; i 0 ) + if (m_deqBufHistory.size()) { - int oldHistoryPos = iHistoryPos; - while( iHistoryPos != 0) + if (iHistoryPos > 0) { iHistoryPos--; - std::wstring& histString = m_deqBufHistory.at(iHistoryPos); - if((int)histString.length() >= m_iBufferPos) - { - bool bad = false; - for(int i=0; i