Skip to content
Snippets Groups Projects
Commit fa50d035 authored by andreas's avatar andreas
Browse files

added missing files from last new_shell commit

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/branches/new_shell@2260 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 8b67744f
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,6 @@
/*
Author: Andreas Schenk
*/
#include "shell_history.hh"
namespace ost { namespace gui {
......@@ -77,29 +76,33 @@ bool ShellHistory::AtEnd()
return index_>=history_list_.size();
}
void ShellHistory::operator--()
void ShellHistory::MoveToPreviousMatch()
{
if(index_>0){
--index_;
int newindex=index_-1;
while(newindex>=0){
if(history_list_[newindex].first.indexOf(current_)==0 || current_.size()==0){
index_=newindex;
break;
}
--newindex;
}
}
void ShellHistory::operator--(int)
{
operator--();
}
void ShellHistory::operator++()
void ShellHistory::MoveToNextMatch()
{
if(index_<history_list_.size()){
++index_;
int newindex=index_+1;
while(newindex<history_list_.size()){
if(history_list_[newindex].first.indexOf(current_)==0 || current_.size()==0){
index_=newindex;
break;
}
++newindex;
}
if(newindex!=index_){
index_=history_list_.size();
}
}
void ShellHistory::operator++(int)
{
operator++();
}
}}//ns
......@@ -38,10 +38,8 @@ public:
QString GetCommand();
BlockEditMode GetCommandMode();
bool AtEnd();
void operator--();
void operator--(int);
void operator++();
void operator++(int);
void MoveToPreviousMatch();
void MoveToNextMatch();
protected:
std::vector<std::pair<QString,BlockEditMode> > history_list_;
QString current_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment