From 45e4e70ec50bc0d743dadc415e0c4a0695ce63fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Fri, 10 Jul 2020 22:29:10 -0300 Subject: make clear the separation of client and buffer --- buffer.cpp | 2 ++ client.cpp | 4 +++- jet.cpp | 2 -- point.cpp | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/buffer.cpp b/buffer.cpp index ba3f87c..9dbf118 100644 --- a/buffer.cpp +++ b/buffer.cpp @@ -1,3 +1,5 @@ +#include "page.cpp" + struct Buffer { const char *name; Page *storage; diff --git a/client.cpp b/client.cpp index 85289b6..05d07a1 100644 --- a/client.cpp +++ b/client.cpp @@ -1,3 +1,5 @@ +#include "point.cpp" + #define MAX_ARGS 16 #define pos(x, y) (x) + (y) * window_w @@ -28,7 +30,7 @@ struct Client { ArgList args; Client(const Buffer &b) : - cursor(b.storage, 0), + cursor(b), window_start(cursor), args(MAX_ARGS) {} diff --git a/jet.cpp b/jet.cpp index 3d45c75..638d728 100644 --- a/jet.cpp +++ b/jet.cpp @@ -11,8 +11,6 @@ #include #include -#include "page.cpp" -#include "point.cpp" #include "buffer.cpp" #include "client.cpp" diff --git a/point.cpp b/point.cpp index 0e80e7f..5422350 100644 --- a/point.cpp +++ b/point.cpp @@ -61,6 +61,7 @@ struct Point { Point() : page(0), index(0) {} Point(Page* page, uint16_t index) : page(page), index(index) {} + Point(const Buffer &b) : page(b.storage), index(0) {} Point(const Point &p) : page(p.page), index(p.index) {} bool operator==(Point p) { -- cgit v1.2.3