diff options
| author | noname@inventati.org <noname@inventati.org> | 2015-04-11 19:30:12 +0200 |
|---|---|---|
| committer | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2015-04-13 09:26:03 +0200 |
| commit | 39ae1a4de5c471c8626c80ef1e961f0c83f5199d (patch) | |
| tree | 006ee317347447642cf6cc2a6d37d8ec9ecfd20b /st.c | |
| parent | tresize: move for loop outside if (diff) | |
| download | st-39ae1a4de5c471c8626c80ef1e961f0c83f5199d.tar.gz st-39ae1a4de5c471c8626c80ef1e961f0c83f5199d.zip | |
Move tresize comments around.
Diffstat (limited to 'st.c')
| -rw-r--r-- | st.c | 11 |
1 files changed, 5 insertions, 6 deletions
| @@ -2779,17 +2779,16 @@ tresize(int col, int row) { | |||
| 2779 | return; | 2779 | return; |
| 2780 | } | 2780 | } |
| 2781 | 2781 | ||
| 2782 | /* free unneeded rows */ | 2782 | /* |
| 2783 | * slide screen to keep cursor where we expect it - | ||
| 2784 | * tscrollup would work here, but we can optimize to | ||
| 2785 | * memmove because we're freeing the earlier lines | ||
| 2786 | */ | ||
| 2783 | for(i = 0; i < slide; i++) { | 2787 | for(i = 0; i < slide; i++) { |
| 2784 | free(term.line[i]); | 2788 | free(term.line[i]); |
| 2785 | free(term.alt[i]); | 2789 | free(term.alt[i]); |
| 2786 | } | 2790 | } |
| 2787 | if(slide > 0) { | 2791 | if(slide > 0) { |
| 2788 | /* | ||
| 2789 | * slide screen to keep cursor where we expect it - | ||
| 2790 | * tscrollup would work here, but we can optimize to | ||
| 2791 | * memmove because we're freeing the earlier lines | ||
| 2792 | */ | ||
| 2793 | memmove(term.line, term.line + slide, row * sizeof(Line)); | 2792 | memmove(term.line, term.line + slide, row * sizeof(Line)); |
| 2794 | memmove(term.alt, term.alt + slide, row * sizeof(Line)); | 2793 | memmove(term.alt, term.alt + slide, row * sizeof(Line)); |
| 2795 | } | 2794 | } |
