temp commit
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "../include/data.h"
|
||||
#include "../include/define.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
@@ -85,6 +86,7 @@ int editorReadKey() {
|
||||
char c;
|
||||
/* read first byte — may be start of UTF-8 or escape */
|
||||
while (read(STDIN_FILENO, &c, 1) != 1);
|
||||
appDebug("f : %X\r\n", c);
|
||||
|
||||
if (c == '\x1b') {
|
||||
char seq[6];
|
||||
@@ -179,3 +181,14 @@ int getWindowSize(int *rows, int *cols) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void appDebug(const char *fmt, ...) {
|
||||
#ifdef APP_DEBUG
|
||||
va_list ap;
|
||||
char message[256];
|
||||
va_start(ap, fmt);
|
||||
vsnprintf(message, 256, fmt, ap);
|
||||
va_end(ap);
|
||||
fprintf(stderr, "%s\n", message);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user