mirror of
https://github.com/janet-lang/janet
synced 2025-07-08 13:02:55 +00:00
Use JANET_PRETTY_DICT_LIMIT.
This commit is contained in:
parent
67fb2c212f
commit
a147ea3e80
@ -591,6 +591,11 @@ static void janet_pretty_one(struct pretty *S, Janet x, int is_dict_value) {
|
|||||||
if (is_dict_value && len >= JANET_PRETTY_DICT_ONELINE) print_newline(S, 0);
|
if (is_dict_value && len >= JANET_PRETTY_DICT_ONELINE) print_newline(S, 0);
|
||||||
for (i = 0; i < cap; i++) {
|
for (i = 0; i < cap; i++) {
|
||||||
if (!janet_checktype(kvs[i].key, JANET_NIL)) {
|
if (!janet_checktype(kvs[i].key, JANET_NIL)) {
|
||||||
|
if (counter == JANET_PRETTY_DICT_LIMIT) {
|
||||||
|
print_newline(S, 0);
|
||||||
|
janet_buffer_push_cstring(S->buffer, "...");
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (first_kv_pair) {
|
if (first_kv_pair) {
|
||||||
first_kv_pair = 0;
|
first_kv_pair = 0;
|
||||||
} else {
|
} else {
|
||||||
@ -600,11 +605,6 @@ static void janet_pretty_one(struct pretty *S, Janet x, int is_dict_value) {
|
|||||||
janet_buffer_push_u8(S->buffer, ' ');
|
janet_buffer_push_u8(S->buffer, ' ');
|
||||||
janet_pretty_one(S, kvs[i].value, 1);
|
janet_pretty_one(S, kvs[i].value, 1);
|
||||||
counter++;
|
counter++;
|
||||||
if (counter == 10) {
|
|
||||||
print_newline(S, 0);
|
|
||||||
janet_buffer_push_cstring(S->buffer, "...");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user