mirror of
https://github.com/RGBCube/serenity
synced 2025-10-17 07:22:23 +00:00
Import a simple text editor I started working on.
This commit is contained in:
parent
405383fd2f
commit
ca6847b5bb
59 changed files with 895 additions and 39 deletions
19
Editor/main.cpp
Normal file
19
Editor/main.cpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
#include "Document.h"
|
||||
#include "Editor.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int c, char** v)
|
||||
{
|
||||
std::string file_to_open = "cuki.h";
|
||||
if (c > 1) {
|
||||
file_to_open = v[1];
|
||||
}
|
||||
auto document = Document::create_from_file(file_to_open);
|
||||
if (!document) {
|
||||
fprintf(stderr, "Failed to open file.\n");
|
||||
return 1;
|
||||
}
|
||||
Editor editor;
|
||||
editor.set_document(std::move(document));
|
||||
return editor.exec();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue