diff --git a/ke/Makefile b/ke/Makefile index 41f39d6..329236b 100644 --- a/ke/Makefile +++ b/ke/Makefile @@ -25,5 +25,9 @@ run: $(BIN) keypress: keypress.c $(CC) $(CFLAGS) $(LDFLAGS) -o $@ keypress.c +.PHONY: install +install: $(BIN) + cp $(BIN) $(HOME)/bin/ + %.o: %.c - $(CC) $(CFLAGS) -c $@ $< + diff --git a/ke/main.c b/ke/main.c index 31b13ef..4c021f6 100644 --- a/ke/main.c +++ b/ke/main.c @@ -237,7 +237,7 @@ insert_row(int at, char *s, size_t len) if (at < editor.nrows) { memmove(&editor.row[at+1], &editor.row[at], - sizeof(erow) * (editor.rows - at + 1)); + sizeof(erow) * (editor.nrows - at + 1)); } editor.row[at].size = len; @@ -835,6 +835,13 @@ process_kcommand(int16_t c) case 'f': editor_find(); break; + case 'm': + if (system("make") != 0) { + editor_set_status("process failed: %s", strerror(errno)); + } else { + editor_set_status("make: ok"); + } + break; } editor.dirtyex = 1;