Commit 74eb758
Address Copilot review comments
- curses_color_content, curses_pair_content: check return value of
extended_color_content/color_content/extended_pair_content/pair_content
and return nil on ERR instead of returning uninitialized values
- curses_reset_color_pairs: add curses_stdscr() call for consistency
with other color APIs
- window_color_set: use wattr_get to preserve existing window attributes
when calling wattr_set; use NCURSES_PAIRS_T for the pair argument to
match the ncurses header type in both standard and extended modes;
fall back to wattr_set without attr preservation if wattr_get is
unavailable, and to wcolor_set if wattr_set is also unavailable
- extconf.rb: add have_func check for wattr_get
- sample/colors.rb: skip pair 0 (cannot be redefined); use i%colors
instead of i%256 to handle terminals with fewer than 256 colors
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 0153604 commit 74eb758
3 files changed
Lines changed: 22 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1410 | 1410 | | |
1411 | 1411 | | |
1412 | 1412 | | |
1413 | | - | |
| 1413 | + | |
| 1414 | + | |
1414 | 1415 | | |
1415 | 1416 | | |
1416 | 1417 | | |
1417 | 1418 | | |
1418 | 1419 | | |
1419 | | - | |
| 1420 | + | |
| 1421 | + | |
1420 | 1422 | | |
1421 | 1423 | | |
1422 | 1424 | | |
| |||
1452 | 1454 | | |
1453 | 1455 | | |
1454 | 1456 | | |
1455 | | - | |
| 1457 | + | |
| 1458 | + | |
1456 | 1459 | | |
1457 | 1460 | | |
1458 | 1461 | | |
1459 | 1462 | | |
1460 | 1463 | | |
1461 | | - | |
| 1464 | + | |
| 1465 | + | |
1462 | 1466 | | |
1463 | 1467 | | |
1464 | 1468 | | |
| |||
1520 | 1524 | | |
1521 | 1525 | | |
1522 | 1526 | | |
| 1527 | + | |
1523 | 1528 | | |
1524 | 1529 | | |
1525 | 1530 | | |
| |||
2792 | 2797 | | |
2793 | 2798 | | |
2794 | 2799 | | |
2795 | | - | |
| 2800 | + | |
| 2801 | + | |
| 2802 | + | |
| 2803 | + | |
| 2804 | + | |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
| 2808 | + | |
| 2809 | + | |
2796 | 2810 | | |
2797 | 2811 | | |
2798 | 2812 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
0 commit comments