mirror of
https://github.com/jarun/nnn.git
synced 2025-01-22 16:56:46 +00:00
Print line number in debug logs
This commit is contained in:
parent
6fcc6834ff
commit
b14e1a4856
11
src/dbg.h
11
src/dbg.h
|
@ -76,10 +76,13 @@ static void disabledbg(void)
|
||||||
close(DEBUG_FD);
|
close(DEBUG_FD);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DPRINTF_D(x) xprintf(DEBUG_FD, #x "=%d [ln %d]\n", x, __LINE__)
|
#define STRINGIFY(x) #x
|
||||||
#define DPRINTF_U(x) xprintf(DEBUG_FD, #x "=%u [ln %d]\n", x, __LINE__)
|
#define TOSTRING(x) STRINGIFY(x)
|
||||||
#define DPRINTF_S(x) xprintf(DEBUG_FD, #x "=%s [ln %d]\n", x, __LINE__)
|
|
||||||
#define DPRINTF_P(x) xprintf(DEBUG_FD, #x "=%p [ln %d]\n", x, __LINE__)
|
#define DPRINTF_D(x) xprintf(DEBUG_FD, "ln " TOSTRING(__LINE__) ": " #x "=%d\n", x, __LINE__)
|
||||||
|
#define DPRINTF_U(x) xprintf(DEBUG_FD, "ln " TOSTRING(__LINE__) ": " #x "=%u\n", x)
|
||||||
|
#define DPRINTF_S(x) xprintf(DEBUG_FD, "ln " TOSTRING(__LINE__) ": " #x "=%s\n", x)
|
||||||
|
#define DPRINTF_P(x) xprintf(DEBUG_FD, "ln " TOSTRING(__LINE__) ": " #x "=%p\n", x)
|
||||||
#else
|
#else
|
||||||
#define DPRINTF_D(x)
|
#define DPRINTF_D(x)
|
||||||
#define DPRINTF_U(x)
|
#define DPRINTF_U(x)
|
||||||
|
|
|
@ -1891,7 +1891,7 @@ static int nextsel(int presel)
|
||||||
|
|
||||||
if (c == 0 || c == MSGWAIT) {
|
if (c == 0 || c == MSGWAIT) {
|
||||||
c = getch();
|
c = getch();
|
||||||
DPRINTF_D(c);
|
//DPRINTF_D(c);
|
||||||
|
|
||||||
if (presel == MSGWAIT) {
|
if (presel == MSGWAIT) {
|
||||||
if (cfg.filtermode)
|
if (cfg.filtermode)
|
||||||
|
@ -4017,7 +4017,7 @@ static void redraw(char *path)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINTF_D(cur);
|
//DPRINTF_D(cur);
|
||||||
DPRINTF_S(path);
|
DPRINTF_S(path);
|
||||||
|
|
||||||
addch('[');
|
addch('[');
|
||||||
|
|
Loading…
Reference in a new issue