Changeset 2395


Ignore:
Timestamp:
Jun 14, 2008, 3:34:09 PM (15 years ago)
Author:
Jean-Yves Lamoureux
Message:
  • Totally unfinished scroll support (as vim uses it)
Location:
neercs/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • neercs/trunk/src/main.c

    r2390 r2395  
    2121#include <unistd.h>
    2222#include <fcntl.h>
    23 #include <sys/types.h>
    2423#include <signal.h>
    2524#include <sys/ioctl.h>
  • neercs/trunk/src/term.c

    r2382 r2395  
    2929{
    3030    unsigned char const *buffer = (unsigned char const*)data;
    31     unsigned int i, j, skip, dummy = 0;
     31    unsigned int i, j, k,skip, dummy = 0;
    3232    unsigned int width, height;
    33     uint32_t savedattr;
     33    uint32_t savedattr, scrolled = 0;
    3434    int x = 0, y = 0, save_x = 0, save_y = 0;
    3535
     
    246246                y = (argc > 0 && argv[0] > 0) ? argv[0] - 1 : 0;
    247247                break;
     248            case 'r': /* SS  (0x72) - Scroll Screen FIXME */
     249
     250                if((argv[0]==0 && argv[1]==0)  || scrolled) break;
     251                for(j = argv[0]-1; j < argv[1]-1; j++)
     252                {
     253                    for(k = 0; k < width; k++)
     254                    {
     255                        cucul_put_char(sc->cv, k, j, cucul_get_char(sc->cv, k, j+1));
     256                        cucul_put_attr(sc->cv, k, j, cucul_get_attr(sc->cv, k, j+1));
     257                    }
     258                }
     259                cucul_draw_line(sc->cv, 0, argv[1]-1, width, argv[1]-1, ' ');
     260                scrolled = 1;
     261                break;
    248262            case 'h': /* SM (0x68) - FIXME */
    249263                debug("ansi import: set mode %i", argc ? (int)argv[0] : -1);
     
    313327                sc->title = string;
    314328            }
    315             else 
     329            else
    316330                free(string);
    317331        }
     
    353367        if((unsigned int)y >= height)
    354368        {
    355             unsigned int k;
    356369            int lines = (y - height) + 1;
    357370
Note: See TracChangeset for help on using the changeset viewer.