From 3b038e8073954bd9306cc47a0af5bbb42f3cda5c Mon Sep 17 00:00:00 2001 From: ElectricAlchemist Date: Fri, 25 Oct 2019 20:20:38 +0200 Subject: [PATCH] now can add chars --- ste | Bin 22512 -> 22168 bytes ste.c | 45 ++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/ste b/ste index dd15d99e9c6bb63eafdbe836b7e19733fc5f466f..18a394e266a1754a194a0f8ae6be5da4ba4ccb72 100755 GIT binary patch literal 22168 zcmeHP4RjO7ogY~i7=pD1Y~p;7sKm6UIUJi{f&&hgk;yuhgF}FXwuun31Ws(rmF4h} z6x<3@bc?{(=6dwwuDteLnl$Yz?e(}E?FHMkHjtD$wB-Hk$-KpJTebPA8D+X;WT0EfBaBlV8-T?G*Kw)M!Vs8L8FnMw-&;VhRA#F+rsrxg)!{u!{>j zNzaQwNGjt=F`?hjMSU`<3o=TQk}jp@SHdln?-A#fNmp|%#w3+?cfpS8`PU{9Ubae< zXBL-oQGZFr>9U*JS~uL()-u1XwWE8>{4I+Y&0n;zqAOUj02QD*72`*ty#3BK?1AFZ z3yU6$RX;xRTmMInw@=>q$rqQA4%LDDkq#x&7sYWp2RzC3^ZJ5?^)N;lrI8!=T>HHL zWV_ByJhsAc#zdH7jx6}U0n4WUI}`lZCU}`ixwB00@0$4Wo8VtC!MjcH&zs=iFu{+T z;P;r+zXJLW{4&#Q6a5=aaJvcK0ms>{%O6c}>N>OOPd34KoA{|S(cfpH|A7hqo(WFf zi37jP^dkV->fdLA-*191Fsc7N(4Wq(Vvf6zL6ZHI3VnHR=@N0oecs{g4t4pvHq-sR zh|pH=b%t6y!kZ-$2q4$e($N)$Dl)!JZ1YBc z7z8Kk)6dYqr8UgDxLtq+f}Q>j*69z0P)x}0ZEFkqP;{sbXuH4N*SVDid~HFTMY}HZ zczofloqo>-4{5?Tx=4zQZ;RIxXzlQ}QQbWrDozBd-HUTZ0Q~HBcVqo>&w`4ZQ@N^z zsqBJ^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=!cNfppr>bLLKe>>1nuMg)P8EGXg`P97BG}k;V+(B2r8b}iTZ`V*#8~e zzkvr7&;JD7%L9`?JtNHb-vx|vLhaLvxG~{WJXaLz{Nt}cVf1%#KS8y3O@uROUU>Fs zp1*jmBB*Gu2q9!aAJ6m8UIg-s!5i>M##luC0{bBtWBV&zx<*j(oK)E7@BdTWUmU;e z^PDQ(qfa<;nqU9Zz^Q)WZ?;~g2$Ns`fjocld`Qss6x>im-UM_M45f&lX4&URVm-@z zdm#&Y62A0IL->p5UEckSx=o2eu91o*yu0rgD=+W_M)A-G`jynz66G1 ziS}pj-#xlTpH8w{SC-Qm`hN%2&%0YzTgv^-<`43rLR9oU4d9!Z++X~ofa19E6Z #include #include +#include /* defines */ #define CTRL(k) ((k) & 0x1f) // Control mask modifier @@ -65,6 +66,7 @@ static int curRealToRender (row *rw, int c_x); /* Row operations */ static inline void rowInit (void); +static void rowAddChar (row *rw, char c); /* Terminal operations */ static void termInit (void); @@ -121,6 +123,8 @@ int main (int argc, char *argv[]) case (KEY_DOWN): cursorMove(c); break; + default: + rowAddChar(&rows.rw[t.cur.y + t.cur.off_y], c); } } @@ -158,7 +162,7 @@ void termInit (void) init_pair(1, COLOR_BLACK, COLOR_WHITE); /* Set default color */ - bkgd(COLOR_PAIR(1)); + //bkgd(COLOR_PAIR(1)); /* Populate the main data structure */ getmaxyx(stdscr, t.dim.y, t.dim.x); @@ -233,14 +237,14 @@ void drawLines (void) attroff(COLOR_PAIR(2)); lnMove(i, 0); - if (ln == t.cur.y + t.cur.off_y) attron(COLOR_PAIR(2)); + //if (ln == t.cur.y + t.cur.off_y) attron(COLOR_PAIR(2)); /* Draw the line matcing render memory */ if (rows.rw[ln].r_size >= t.cur.off_x) { addnstr(&rows.rw[ln].render[t.cur.off_x], t.dim.x + 1 - rows.rw[ln].delta); } - attroff(COLOR_PAIR(2)); + //attroff(COLOR_PAIR(2)); lnMove(++line, 0); } @@ -258,7 +262,7 @@ void lnMove (int y, int x) void drawBar (char *s) { /* Set maximum contrast for bar */ - attron(A_STANDOUT); + attron(COLOR_PAIR(2)); /* get the length of the statusbar text */ int len = strlen(s); /* Print the message */ @@ -272,7 +276,7 @@ void drawBar (char *s) mvaddstr(t.dim.y, t.dim.x + t.pad - strlen(m), m); /* Return to normal contrast mode */ - attroff(A_STANDOUT); + attroff(COLOR_PAIR(2)); } /* convert the cursor matchoing the memory to the drawn one */ @@ -368,6 +372,37 @@ void rowInit (void) rows.rownum = 0; } +void rowAddChar (row *rw, char c) // WIP +{ + // Error checking + if (!c || iscntrl(c)) return; + + int cur = t.cur.x + t.cur.off_x, i = 0; + char *s = rw->chars; + + // reallocate mem and inc size + rw->chars = malloc(rw->size + 2); + rw->size++; + + // copy bf cursor + for (i = 0; i < cur; i++) { + rw->chars[i] = s[i]; + } + + // add at cursor + rw->chars[cur++] = (char)c; + + //copy after cursor + for (i = cur; i < rw->size + 1; i++) { + rw->chars[i] = s[i - 1]; + } + + free(s); + + updateRender(rw); + t.cur.x++; +} + /* ----------------------------- file operations --------------------------- */ /* take care of the cursor movement */