PromptMode: fix completion of non-last parameters

This commit is contained in:
Maxime Coste 2012-09-17 13:37:08 +02:00
parent ebae75e96e
commit 00e357ed56

View File

@ -245,6 +245,7 @@ public:
if (not contains(candidates, prefix))
candidates.push_back(std::move(prefix));
}
if (not reverse and ++m_current_completion >= candidates.size())
m_current_completion = 0;
if (reverse and --m_current_completion < 0)
@ -252,7 +253,8 @@ public:
const String& completion = candidates[m_current_completion];
m_client.menu_select(m_current_completion);
m_result = m_result.substr(0, m_completions.start) + completion;
m_result = m_result.substr(0, m_completions.start) + completion
+ m_result.substr(m_cursor_pos);
m_cursor_pos = m_completions.start + completion.length();
}
else