mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-21 02:37:13 +08:00
fish_key_reader: ms were off by factor of ten.
Improve output.
This commit is contained in:
parent
7a4065eb9f
commit
9c53019d95
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
struct config_paths_t determine_config_directory_paths(const char *argv0);
|
struct config_paths_t determine_config_directory_paths(const char *argv0);
|
||||||
|
|
||||||
long double prev_tstamp = std::numeric_limits<long double>::quiet_NaN();
|
double prev_tstamp = std::numeric_limits<double>::quiet_NaN();
|
||||||
|
|
||||||
static const char *ctrl_equivalents[] = {"\\000", "\\001", "\\002", "\\003", "\\004", "\\005", "\\006", "\\a",
|
static const char *ctrl_equivalents[] = {"\\000", "\\001", "\\002", "\\003", "\\004", "\\005", "\\006", "\\a",
|
||||||
"\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\014", "\\015",
|
"\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\014", "\\015",
|
||||||
|
@ -85,12 +85,11 @@ void process_input(bool continuous_mode) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double delta_tstamp = (timef() - prev_tstamp);
|
||||||
long double delta_tstamp = (timef() - prev_tstamp) * 100;
|
// double timef() is time in seconds since unix epoch with ~microsecondish precision
|
||||||
|
|
||||||
prev_tstamp = timef();
|
prev_tstamp = timef();
|
||||||
|
|
||||||
if (delta_tstamp > 20000) {
|
if (delta_tstamp > 20) {
|
||||||
printf("Type 'exit' or 'quit' to terminate this program.\n");
|
printf("Type 'exit' or 'quit' to terminate this program.\n");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
@ -102,7 +101,7 @@ void process_input(bool continuous_mode) {
|
||||||
printf("dec: %3u hex: %2x char: %s (aka \\c%c)", c, c,
|
printf("dec: %3u hex: %2x char: %s (aka \\c%c)", c, c,
|
||||||
ctrl_equivalents[c], c + 64);
|
ctrl_equivalents[c], c + 64);
|
||||||
} else {
|
} else {
|
||||||
printf("dec: %3u hex: %2x char: \\c%c", c, c, c + 64);
|
printf("dec: %3u hex: %2x char: \\c%c\t", c, c, c + 64);
|
||||||
}
|
}
|
||||||
} else if (c == 32) {
|
} else if (c == 32) {
|
||||||
// The space character.
|
// The space character.
|
||||||
|
@ -115,11 +114,11 @@ void process_input(bool continuous_mode) {
|
||||||
printf("dec: %3u hex: %2x char: non-ASCII", c, c);
|
printf("dec: %3u hex: %2x char: non-ASCII", c, c);
|
||||||
} else {
|
} else {
|
||||||
// ASCII characters that are not control characters.
|
// ASCII characters that are not control characters.
|
||||||
printf("dec: %3u hex: %2x char: %c", c, c, c);
|
printf("dec: %3u hex: %2x char: %c\t", c, c, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!std::isnan(delta_tstamp)) {
|
if (!std::isnan(delta_tstamp)) {
|
||||||
printf(" (%.2Lf ms)\n", delta_tstamp);
|
printf("\t(%6.lf ms)\n", delta_tstamp * 1000);
|
||||||
} else {
|
} else {
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user