Commit c30a49b
committed
string-util: tweak ellipsation a bit
This primarily changes to things:
1. Ellipsation to 0, 1 or 2 characters is now supported. Previously we'd
hit an assert if the new lengths was < 3, this is now permitted. The
result strings won't show too much info still of course, but the code
becomes a bit more generic and robust to use.
2. If a UTF-8 mode is disabled and the input string is pure ASCII, then
"..." is used for ellipsation, otherwise (as before) "…". This means
on a pure-ASCII system we should remain pure-ASCII, matching
behaviour otherwise exposed with special_glyph() and friends. Note
that we'll use "…" for ellipsiation as soon as either the locale
settings indicate an UTF-8 mode or the input string already contains
non-ASCII unicode characters.
Testing for these special cases is improved.1 parent adea407 commit c30a49b
2 files changed
+92
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
452 | 453 | | |
453 | 454 | | |
454 | 455 | | |
455 | | - | |
| 456 | + | |
456 | 457 | | |
457 | 458 | | |
458 | 459 | | |
459 | 460 | | |
460 | | - | |
| 461 | + | |
461 | 462 | | |
462 | | - | |
| 463 | + | |
463 | 464 | | |
464 | 465 | | |
465 | | - | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
466 | 494 | | |
467 | 495 | | |
468 | 496 | | |
469 | | - | |
| 497 | + | |
470 | 498 | | |
471 | | - | |
472 | | - | |
| 499 | + | |
| 500 | + | |
473 | 501 | | |
474 | 502 | | |
475 | | - | |
476 | | - | |
477 | | - | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
478 | 514 | | |
479 | | - | |
480 | | - | |
| 515 | + | |
| 516 | + | |
481 | 517 | | |
482 | 518 | | |
483 | 519 | | |
484 | 520 | | |
485 | 521 | | |
486 | | - | |
487 | | - | |
| 522 | + | |
488 | 523 | | |
489 | | - | |
| 524 | + | |
490 | 525 | | |
491 | 526 | | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
492 | 539 | | |
493 | 540 | | |
494 | 541 | | |
495 | 542 | | |
496 | 543 | | |
497 | 544 | | |
498 | | - | |
| 545 | + | |
| 546 | + | |
499 | 547 | | |
500 | | - | |
| 548 | + | |
501 | 549 | | |
502 | 550 | | |
503 | 551 | | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
| 552 | + | |
| 553 | + | |
511 | 554 | | |
512 | 555 | | |
513 | 556 | | |
| |||
552 | 595 | | |
553 | 596 | | |
554 | 597 | | |
555 | | - | |
| 598 | + | |
556 | 599 | | |
557 | 600 | | |
558 | 601 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
20 | 44 | | |
21 | 45 | | |
22 | 46 | | |
| |||
0 commit comments