]> git.mdlowis.com Git - projs/tide.git/commitdiff
removed status region
authorMichael D. Lowis <mike@mdlowis.com>
Fri, 2 Mar 2018 02:05:27 +0000 (21:05 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Fri, 2 Mar 2018 02:05:27 +0000 (21:05 -0500)
inc/win.h
lib/win.c
pick.c
tide.c

index 6a4f5c73eb0f32f8778c761d0faa56bd381dfe5a..d1cef57cee835970cc2c16e0cf3e1ac6f58762fb 100644 (file)
--- a/inc/win.h
+++ b/inc/win.h
@@ -7,12 +7,11 @@ enum {
 };
 
 typedef enum {
-    STATUS   = 0,
-    TAGS     = 1,
-    EDIT     = 2,
-    SCROLL   = 3,
-    NREGIONS = 4,
-    FOCUSED  = 4
+    TAGS     = 0,
+    EDIT     = 1,
+    SCROLL   = 2,
+    NREGIONS = 3,
+    FOCUSED  = 3
 } WinRegion;
 
 typedef struct {
index 67f9bfdf416d44140d0d116c671fd746089a7a8a..55fc9e9e7ba88a9516430fee4ef61894d70dfcaa 100644 (file)
--- a/lib/win.c
+++ b/lib/win.c
@@ -42,7 +42,6 @@ static void win_init(void (*errfn)(char*)) {
         view_init(&(Regions[i].view), NULL, errfn);
     x11_init(&Config);
     Font = x11_font_load(config_get_str(FontString));
-    Regions[STATUS].clrnor = config_get_int(ClrStatusNor);
     Regions[SCROLL].clrnor = config_get_int(ClrScrollNor);
     Regions[TAGS].clrnor = config_get_int(ClrTagsNor);
     Regions[TAGS].clrsel = config_get_int(ClrTagsSel);
@@ -195,7 +194,6 @@ static size_t gutter_size(void) {
 static void layout(int width, int height) {
     size_t fheight = x11_font_height(Font);
     size_t fwidth  = x11_font_width(Font);
-    View* statview = win_view(STATUS);
     View* tagview  = win_view(TAGS);
     View* editview = win_view(EDIT);
 
@@ -209,11 +207,7 @@ static void layout(int width, int height) {
         Regions[i].height = fheight;
     }
 
-    /* place the status region */
-    view_resize(statview, 1, Regions[STATUS].width / fwidth);
-
     /* Place the tag region relative to status */
-    Regions[TAGS].y = 5 + Regions[STATUS].y + Regions[STATUS].height;
     size_t maxtagrows = ((height - Regions[TAGS].y - 5) / 4) / fheight;
     size_t tagcols    = Regions[TAGS].width / fwidth;
     size_t tagrows    = view_limitrows(tagview, maxtagrows, tagcols);
@@ -240,7 +234,6 @@ static void onredraw(int width, int height) {
 
     layout(width, height);
     onupdate(); // Let the user program update the status and other content
-    view_update(win_view(STATUS), Regions[STATUS].clrnor, Regions[STATUS].clrsel, &(Regions[STATUS].csrx), &(Regions[STATUS].csry));
     view_update(win_view(TAGS),   Regions[TAGS].clrnor,   Regions[TAGS].clrsel,   &(Regions[TAGS].csrx),   &(Regions[TAGS].csry));
     view_update(win_view(EDIT),   Regions[EDIT].clrnor,   Regions[EDIT].clrsel,   &(Regions[EDIT].csrx),   &(Regions[EDIT].csry));
     onlayout(); // Let the user program update the scroll bar
diff --git a/pick.c b/pick.c
index eb9b95cd500386640572c93a66c629ea0cee2b0c..0400d22193738077f5789148e248ec45f7a1812f 100644 (file)
--- a/pick.c
+++ b/pick.c
@@ -222,12 +222,10 @@ static KeyBinding Bindings[] = {
 
 #ifndef TEST
 int main(int argc, char** argv) {
-    char* title = getenv("PICKTITLE");
     load_choices();
     if (vec_size(&Choices) > 1) {
         win_window("pick", true, onerror);
         win_setkeys(Bindings, NULL);
-        win_settext(STATUS, (title ? title : "pick"));
         if (argc >= 2) {
             for (char* str = argv[1]; *str; str++)
                 buf_insert(win_buf(TAGS), false, Pos++, *str);
diff --git a/tide.c b/tide.c
index e2bf28fbd2c5699e35388c886fa53a64b2a4faf5..64b40bcc32d44d91376671e6a05382102daec0fd 100644 (file)
--- a/tide.c
+++ b/tide.c
@@ -486,28 +486,6 @@ void onfocus(bool focused) {
 }
 
 void onupdate(void) {
-    static char status_bytes[256];
-    memset(status_bytes, 0, sizeof(status_bytes));
-    char* status = status_bytes;
-    Buf* buf = win_buf(EDIT);
-    *(status++) = (buf->charset == BINARY ? 'B' : 'U');
-    *(status++) = (buf->crlf ? 'C' : 'N');
-    *(status++) = (buf->expand_tabs ? 'S' : 'T');
-    *(status++) = (buf->copy_indent ? 'I' : 'i');
-    *(status++) = (SearchDir < 0 ? '<' : '>');
-    *(status++) = (buf->modified ? '*' : ' ');
-    *(status++) = ' ';
-    size_t remlen = sizeof(status_bytes) - strlen(status_bytes) - 1;
-    if (pty_active()) {
-        char* path = getcurrdir();
-        strncat(status, path, remlen);
-        free(path);
-    } else {
-        char* path = (buf->path ? buf->path : "*scratch*");
-        strncat(status, path, remlen);
-    }
-    win_settext(STATUS, status_bytes);
-    win_view(STATUS)->selection = (Sel){0,0,0};
 }
 
 void onlayout(void) {