#include <config.h>
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
#include "ControlCommandBuffer.h"
+#include "bufferview_funcs.h"
+#include "debug.h"
+#include "lyxfunc.h"
+#include "LyXAction.h"
+#include "frontends/LyXView.h"
#include "support/lyxalgo.h"
#include "support/lstrings.h"
-#include "LyXAction.h"
-#include "lyxfunc.h"
-#include "debug.h"
+
+using namespace lyx::support;
using std::vector;
using std::back_inserter;
using std::transform;
using std::endl;
+using namespace bv_funcs;
namespace {
} // end of anon namespace
-ControlCommandBuffer::ControlCommandBuffer(LyXFunc & lf)
- : lyxfunc_(lf), history_pos_(history_.end())
+ControlCommandBuffer::ControlCommandBuffer(LyXView & lv)
+ : lv_(lv), history_pos_(history_.end())
{
transform(lyxaction.func_begin(), lyxaction.func_end(),
back_inserter(commands_), lyx::firster());
}
+string const ControlCommandBuffer::getCurrentState() const
+{
+ return currentState(lv_.view().get());
+}
+
+
vector<string> const
ControlCommandBuffer::completions(string const & prefix, string & new_prefix)
{
history_.push_back(str);
history_pos_ = history_.end();
- lyxfunc_.dispatch(str, true);
+ lv_.getLyXFunc().dispatch(str, true);
}