Skip to content

Commit

Permalink
fixed history navigation
Browse files Browse the repository at this point in the history
Task #120 - history navigation gets stuck after first item
  • Loading branch information
grzegorzmazur committed Aug 20, 2015
1 parent f41aad1 commit 90f613b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/commandline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ bool CConsoleHistory::ArrowUp(std::string& s, unsigned c)
if (history == 0)
return false;

const std::string prefix(s, c);
const std::string prefix(s, 0, c);

std::vector<std::string>::reverse_iterator p = iHistory.rbegin();
std::advance(p, iHistory.size() - history);
Expand All @@ -244,7 +244,7 @@ bool CConsoleHistory::ArrowDown(std::string& s, unsigned c)
if (history > iHistory.size())
return false;

const std::string prefix(s, c);
const std::string prefix(s, 0, c);

std::vector<std::string>::iterator p = iHistory.begin();
std::advance(p, history + 1);
Expand Down

0 comments on commit 90f613b

Please sign in to comment.