Add TestFrontend documentation and UndoSystem buffer reference update.
- Document `TestFrontend` for programmatic testing, including examples and usage details. - Add `UpdateBufferReference` to `UndoSystem` to support updating buffer associations.
This commit is contained in:
34
TestFrontend.cc
Normal file
34
TestFrontend.cc
Normal file
@@ -0,0 +1,34 @@
|
||||
#include "TestFrontend.h"
|
||||
#include "Editor.h"
|
||||
#include "Command.h"
|
||||
#include <iostream>
|
||||
|
||||
|
||||
bool
|
||||
TestFrontend::Init(Editor &ed)
|
||||
{
|
||||
ed.SetDimensions(24, 80);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TestFrontend::Step(Editor &ed, bool &running)
|
||||
{
|
||||
MappedInput mi;
|
||||
if (input_.Poll(mi)) {
|
||||
if (mi.hasCommand) {
|
||||
Execute(ed, mi.id, mi.arg, mi.count);
|
||||
}
|
||||
}
|
||||
|
||||
if (ed.QuitRequested()) {
|
||||
running = false;
|
||||
}
|
||||
|
||||
renderer_.Draw(ed);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TestFrontend::Shutdown() {}
|
||||
Reference in New Issue
Block a user