Skip to content

Commit 60c33b3

Browse files
committed
new styling for me
1 parent 7f01a66 commit 60c33b3

File tree

5 files changed

+82
-62
lines changed

5 files changed

+82
-62
lines changed

Diff for: buffer.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -592,8 +592,8 @@ ce_buffer_map(struct cebuf *buf)
592592

593593
ce_syntax_finalize();
594594

595-
ce_term_writestr(TERM_SEQUENCE_ATTR_BOLD);
596-
ce_term_color(TERM_COLOR_BLUE + TERM_COLOR_FG);
595+
ce_term_attr_bold();
596+
ce_term_foreground_rgb(52, 119, 115);
597597

598598
while (line <= buf->height) {
599599
ce_term_setpos(line, TERM_CURSOR_MIN);
@@ -2086,7 +2086,7 @@ ce_buffer_alloc(int internal)
20862086
buf->orig_column = TERM_CURSOR_MIN;
20872087

20882088
buf->width = ce_term_width();
2089-
buf->height = ce_term_height() - 3;
2089+
buf->height = ce_term_height() - 2;
20902090

20912091
buf->line = buf->orig_line;
20922092
buf->column = buf->orig_column;

Diff for: ce.h

+2
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,8 @@ void ce_term_update_title(void);
381381
void ce_term_setpos(size_t, size_t);
382382
void ce_term_writestr(const char *);
383383
void ce_term_write(const void *, size_t);
384+
void ce_term_foreground_rgb(int, int, int);
385+
void ce_term_background_rgb(int, int, int);
384386
void ce_term_writef(const char *, ...)
385387
__attribute__((format (printf, 1, 2)));
386388

Diff for: editor.c

+11-16
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ ce_editor_loop(void)
418418
editor_draw_cmdbuf();
419419

420420
if (splash) {
421+
ce_term_foreground_rgb(52, 119, 115);
421422
ce_term_writestr(TERM_SEQUENCE_CURSOR_SAVE);
422423
ce_term_setpos(ce_term_height() * 0.45,
423424
(ce_term_width() / 2) -
@@ -428,6 +429,7 @@ ce_editor_loop(void)
428429
(sizeof(CE_SPLASH_TEXT_2) - 1) / 2);
429430
ce_term_writestr(CE_SPLASH_TEXT_2);
430431
ce_term_writestr(TERM_SEQUENCE_CURSOR_RESTORE);
432+
ce_term_attr_off();
431433
}
432434

433435
editor_draw_status();
@@ -945,15 +947,15 @@ editor_draw_status(void)
945947
procfd = (curbuf->proc != NULL) ? curbuf->proc->ofd : -1;
946948

947949
if (curbuf->top == 0) {
948-
llen = snprintf(lline, sizeof(lline), "%zuL [Top]%s",
950+
llen = snprintf(lline, sizeof(lline), "%zuL [Top]%s ",
949951
curbuf->lcnt, procfd != -1 ? " *" : "");
950952
} else if (curbuf->lcnt - (curbuf->top + curbuf->line) <
951953
((ce_term_height() - 2) / 2)) {
952-
llen = snprintf(lline, sizeof(lline), "%zuL [Bot]%s",
954+
llen = snprintf(lline, sizeof(lline), "%zuL [Bot]%s ",
953955
curbuf->lcnt, procfd != -1 ? " *" : "");
954956
} else {
955957
pc = ((curbuf->top + curbuf->line) / (float)curbuf->lcnt) * 100;
956-
llen = snprintf(lline, sizeof(lline), "%zuL [%zu%%]%s",
958+
llen = snprintf(lline, sizeof(lline), "%zuL [%zu%%]%s ",
957959
curbuf->lcnt, pc, procfd != -1 ? " *" : "");
958960
}
959961

@@ -998,19 +1000,11 @@ editor_draw_status(void)
9981000
ce_term_writestr(ce_editor_shortpath(curdir));
9991001
}
10001002

1001-
width = ce_term_width();
1002-
ce_term_setpos(ce_term_height() - 2, TERM_CURSOR_MIN);
1003-
ce_term_writestr(TERM_SEQUENCE_LINE_ERASE);
1004-
ce_term_color(TERM_COLOR_WHITE + TERM_COLOR_FG);
1005-
while (width > 0) {
1006-
ce_term_writestr(CE_UTF8_U2015);
1007-
width--;
1008-
}
1009-
10101003
ce_term_setpos(ce_term_height() - 1, TERM_CURSOR_MIN);
10111004
ce_term_writestr(TERM_SEQUENCE_LINE_ERASE);
10121005
ce_term_color(TERM_COLOR_WHITE + TERM_COLOR_FG);
1013-
ce_term_writef("%s %s", &fline[cmdoff], sline);
1006+
ce_term_background_rgb(52, 119, 115);
1007+
ce_term_writef(" %s %s", &fline[cmdoff], sline);
10141008

10151009
if ((size_t)(slen + flen) < (ce_term_width() - llen)) {
10161010
width = (ce_term_width() - llen) - (slen + flen);
@@ -1652,9 +1646,10 @@ editor_cmd_suggestions(struct cehist *hist, size_t histlen)
16521646
if (idx == 5) {
16531647
ce_buffer_appendf(suggestions,
16541648
TERM_SEQUENCE_FMT_SET_COLOR,
1655-
TERM_COLOR_GREEN + TERM_COLOR_FG);
1656-
ce_buffer_appendf(suggestions, "%s%s\n",
1657-
txt[idx], TERM_SEQUENCE_ATTR_OFF);
1649+
TERM_COLOR_BLACK + TERM_COLOR_FG);
1650+
ce_buffer_appendf(suggestions, "%s%s%s\n",
1651+
TERM_SEQUENCE_ATTR_BOLD, txt[idx],
1652+
TERM_SEQUENCE_ATTR_OFF);
16581653
} else {
16591654
ce_buffer_appendf(suggestions,
16601655
"%s\n", txt[idx]);

0 commit comments

Comments
 (0)