8 import std.file: readText, exists, isDir;
10 void main(string[] args) {
14 if (args.length > 1) {
16 if (exists(filename)) {
17 if (isDir(filename)) {
18 writeln(filename, " is a directory");
21 fileTxt = readText(filename);
22 if (fileTxt is null) {
27 if (stdin.size != 0) {
28 foreach (line; stdin.byLine()) {
29 fileTxt ~= line ~ "\n";
35 Buffer buf = new Buffer(fileTxt, filename);
38 Cursor cursor = new Cursor();
39 View v = new View(buf, cursor);
41 setInputMode(InputMode.mouse);
45 while (e.key != Key.ctrlQ) {
55 } catch (object.Error e) {
59 } catch (Exception e) {