… | |
… | |
30 | |
30 | |
31 | #include <inttypes.h> |
31 | #include <inttypes.h> |
32 | |
32 | |
33 | #include "salloc.C" // HACK, should be a seperate compile! |
33 | #include "salloc.C" // HACK, should be a seperate compile! |
34 | |
34 | |
35 | inline void fill_text (text_t *start, text_t value, int len) |
35 | static inline void fill_text (text_t *start, text_t value, int len) |
36 | { |
36 | { |
37 | while (len--) |
37 | while (len--) |
38 | *start++ = value; |
38 | *start++ = value; |
39 | } |
39 | } |
40 | |
40 | |
… | |
… | |
405 | CLEAR_ALL_SELECTION (); |
405 | CLEAR_ALL_SELECTION (); |
406 | |
406 | |
407 | prev_nrow = nrow; |
407 | prev_nrow = nrow; |
408 | prev_ncol = ncol; |
408 | prev_ncol = ncol; |
409 | |
409 | |
410 | tabs = (char *)rxvt_malloc (ncol * sizeof (char)); |
410 | tabs = (char *)rxvt_malloc (ncol); |
411 | |
411 | |
412 | for (int col = ncol; --col; ) |
412 | for (int col = ncol; --col; ) |
413 | tabs [col] = col % TABSIZE == 0; |
413 | tabs [col] = col % TABSIZE == 0; |
414 | |
414 | |
415 | if (current_screen != PRIMARY) |
415 | if (current_screen != PRIMARY) |
… | |
… | |
1621 | */ |
1621 | */ |
1622 | void |
1622 | void |
1623 | rxvt_term::scr_set_tab (int mode) NOTHROW |
1623 | rxvt_term::scr_set_tab (int mode) NOTHROW |
1624 | { |
1624 | { |
1625 | if (mode < 0) |
1625 | if (mode < 0) |
1626 | memset (tabs, 0, ncol * sizeof (char)); |
1626 | memset (tabs, 0, ncol); |
1627 | else if (screen.cur.col < ncol) |
1627 | else if (screen.cur.col < ncol) |
1628 | tabs [screen.cur.col] = !!mode; |
1628 | tabs [screen.cur.col] = !!mode; |
1629 | } |
1629 | } |
1630 | |
1630 | |
1631 | /* ------------------------------------------------------------------------- */ |
1631 | /* ------------------------------------------------------------------------- */ |
… | |
… | |
1801 | for (i = PART_BEG; i < RC_COUNT; i++) |
1801 | for (i = PART_BEG; i < RC_COUNT; i++) |
1802 | { |
1802 | { |
1803 | min_it (rc[i].col, ncol - 1); |
1803 | min_it (rc[i].col, ncol - 1); |
1804 | min_it (rc[i].row, nrow - 1); |
1804 | min_it (rc[i].row, nrow - 1); |
1805 | } |
1805 | } |
1806 | |
1806 | // TODO: this line somehow causes segfault if scr_expose() is called just after resize |
1807 | for (i = rc[PART_BEG].row; i <= rc[PART_END].row; i++) |
1807 | for (i = rc[PART_BEG].row; i <= rc[PART_END].row; i++) |
1808 | fill_text (&drawn_buf[i].t[rc[PART_BEG].col], 0, rc[PART_END].col - rc[PART_BEG].col + 1); |
1808 | fill_text (&drawn_buf[i].t[rc[PART_BEG].col], 0, rc[PART_END].col - rc[PART_BEG].col + 1); |
1809 | |
1809 | |
1810 | num_scr_allow = 0; |
1810 | num_scr_allow = 0; |
1811 | |
1811 | |