From effa24737d6997dc40508533635accca3ed099e9 Mon Sep 17 00:00:00 2001 From: "Esteban I. Ruiz Moreno" Date: Sun, 2 Jun 2013 21:16:32 -0300 Subject: Use the console instead of a dedicated window when pressing keymap_chat/cmd keymap_console opens a full window for chat history browsing. --- src/chat.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/chat.cpp') diff --git a/src/chat.cpp b/src/chat.cpp index 50391d39b..d8cf3efd9 100644 --- a/src/chat.cpp +++ b/src/chat.cpp @@ -417,20 +417,18 @@ void ChatPrompt::input(const std::wstring &str) m_nick_completion_end = 0; } -std::wstring ChatPrompt::submit() +void ChatPrompt::addToHistory(std::wstring line) { - std::wstring line = m_line; - m_line.clear(); if (!line.empty()) m_history.push_back(line); if (m_history.size() > m_history_limit) m_history.erase(m_history.begin()); m_history_index = m_history.size(); - m_view = 0; - m_cursor = 0; - m_nick_completion_start = 0; - m_nick_completion_end = 0; - return line; +} + +std::wstring ChatPrompt::getLine() +{ + return m_line; } void ChatPrompt::clear() @@ -442,13 +440,15 @@ void ChatPrompt::clear() m_nick_completion_end = 0; } -void ChatPrompt::replace(std::wstring line) +std::wstring ChatPrompt::replace(std::wstring line) { + std::wstring old_line = m_line; m_line = line; m_view = m_cursor = line.size(); clampView(); m_nick_completion_start = 0; m_nick_completion_end = 0; + return old_line; } void ChatPrompt::historyPrev() -- cgit v1.2.3