forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0e0776b
committed
Rework wrap-width calculation in psql's print_aligned_vertical() function.
This area was rather heavily whacked around in6513633 and follow-oncommits, and it was showing it, because the logic to calculate theallowable data width in wrapped expanded mode had only the vaguestrelationship to the logic that was actually printing the data. It wasnot very close to being right about the conditions requiring overheadcolumns to be added. Aside from being wrong, it was pretty unreadableand under-commented. Rewrite it so it corresponds to what the printingcode actually does.In passing, remove a couple of dead tests in the printing logic, too.Per a complaint from Jeff Janes, though this doesn't look much like hispatch because it fixes a number of other corner-case bogosities too.One such fix that's visible in the regression test results is thatalthough the code was attempting to enforce a minimum data width of3 columns, it sometimes left less space than that available.1 parent3690dc6 commit0e0776b
3 files changed
+510
-153
lines changedLines changed: 76 additions & 51 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1346 | 1346 |
| |
1347 | 1347 |
| |
1348 | 1348 |
| |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
1349 | 1352 |
| |
1350 | 1353 |
| |
1351 |
| - | |
1352 |
| - | |
1353 |
| - | |
1354 |
| - | |
1355 |
| - | |
1356 |
| - | |
1357 |
| - | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
1358 | 1357 |
| |
1359 | 1358 |
| |
1360 | 1359 |
| |
1361 | 1360 |
| |
1362 |
| - | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
1363 | 1365 |
| |
1364 | 1366 |
| |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
1365 | 1371 |
| |
1366 | 1372 |
| |
1367 | 1373 |
| |
1368 | 1374 |
| |
1369 |
| - | |
1370 |
| - | |
| 1375 | + | |
| 1376 | + | |
1371 | 1377 |
| |
1372 | 1378 |
| |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
1373 | 1383 |
| |
1374 | 1384 |
| |
1375 |
| - | |
| 1385 | + | |
1376 | 1386 |
| |
1377 |
| - | |
1378 |
| - | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
1379 | 1391 |
| |
1380 | 1392 |
| |
| 1393 | + | |
1381 | 1394 |
| |
1382 |
| - | |
1383 |
| - | |
1384 |
| - | |
1385 |
| - | |
1386 |
| - | |
1387 |
| - | |
1388 |
| - | |
1389 |
| - | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
1390 | 1399 |
| |
1391 |
| - | |
1392 |
| - | |
1393 |
| - | |
| 1400 | + | |
1394 | 1401 |
| |
1395 | 1402 |
| |
1396 |
| - | |
1397 |
| - | |
1398 |
| - | |
1399 |
| - | |
1400 |
| - | |
| 1403 | + | |
1401 | 1404 |
| |
1402 | 1405 |
| |
1403 | 1406 |
| |
1404 | 1407 |
| |
1405 | 1408 |
| |
1406 | 1409 |
| |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
1407 | 1420 |
| |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
1408 | 1424 |
| |
1409 | 1425 |
| |
1410 |
| - | |
1411 | 1426 |
| |
1412 |
| - | |
1413 |
| - | |
1414 |
| - | |
1415 |
| - | |
1416 |
| - | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
1417 | 1442 |
| |
1418 | 1443 |
| |
1419 |
| - | |
| 1444 | + | |
| 1445 | + | |
1420 | 1446 |
| |
1421 |
| - | |
1422 |
| - | |
1423 |
| - | |
1424 |
| - | |
1425 |
| - | |
1426 |
| - | |
1427 |
| - | |
1428 |
| - | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
1429 | 1455 |
| |
1430 |
| - | |
| 1456 | + | |
| 1457 | + | |
1431 | 1458 |
| |
1432 | 1459 |
| |
1433 | 1460 |
| |
| |||
1558 | 1585 |
| |
1559 | 1586 |
| |
1560 | 1587 |
| |
1561 |
| - | |
| 1588 | + | |
1562 | 1589 |
| |
1563 |
| - | |
1564 |
| - | |
1565 | 1590 |
| |
1566 |
| - | |
| 1591 | + | |
1567 | 1592 |
| |
1568 | 1593 |
| |
1569 | 1594 |
| |
| |||
1574 | 1599 |
| |
1575 | 1600 |
| |
1576 | 1601 |
| |
1577 |
| - | |
| 1602 | + | |
1578 | 1603 |
| |
1579 |
| - | |
| 1604 | + | |
1580 | 1605 |
| |
1581 | 1606 |
| |
1582 | 1607 |
| |
|
0 commit comments
Comments
(0)