summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorWormHeamer2026-01-01 04:08:12 -0500
committerWormHeamer2026-01-01 04:08:12 -0500
commitd862b833292133948e67bfd39a20d825bc80733e (patch)
tree86be2fe6071b763184e351d0fe19a4511675ed12 /main.c
parent93752fb1107536a5e1dff26767b80e045ad220e9 (diff)
add FG_DEFAULT/BG_DEFAULT and J to join lines
Diffstat (limited to 'main.c')
-rw-r--r--main.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/main.c b/main.c
index cf6c18c..a1281a9 100644
--- a/main.c
+++ b/main.c
@@ -393,9 +393,6 @@ int shell_run(const char *cmd) {
/* main */
-#define ODD_ATTR (FG_CYAN | BG_BLACK)
-#define EVEN_ATTR (FG_WHITE | BG_BLACK)
-
void find_view_window(TxtLoc l, TxtLoc *start, TxtLoc *end, u32 lines) {
u32 u = lines / 2;
TxtLoc a = l;
@@ -419,9 +416,9 @@ void draw(void *ctx) {
TxtLoc start, end;
find_view_window(eb->cur, &start, &end, LINES - 1);
- VuiAttr norm = FG_CYAN | BG_BLACK;
- VuiAttr sel = FG_BLACK | BG_CYAN;
- VuiAttr txt = FG_WHITE | BG_BLACK;
+ VuiAttr norm = A_DEFAULT;
+ VuiAttr sel = norm | A_REVERSE;
+ VuiAttr txt = A_DEFAULT;
vui_fill(' ', txt);
{
@@ -1089,6 +1086,15 @@ int main(int argc, const char **argv) {
eb->cur = txt_delete_range(start, end);
e.mode = 1;
} break;
+ case 'J': {
+ TxtLoc l = end_of_line(eb->cur);
+ if (txt_byte(l) == '\n') {
+ do l = txt_delete_c(cnext(l));
+ while (is_space(txt_chr(l)));
+ l = cprev(txt_insert_c(l, ' '));
+ eb->cur = l;
+ }
+ } break;
case 'c': {
TxtLoc before = eb->cur;
if (motion(&eb->cur, vui_key())) {
@@ -1245,4 +1251,4 @@ int main(int argc, const char **argv) {
vui_fini();
arena_free(&e.scratch);
return 0;
-}
+} \ No newline at end of file