Mistaken identity in sesssaver() was breaking saved-session edit box
[u/mdw/putty] / terminal.c
index d567f7d..f5a2ae0 100644 (file)
@@ -211,6 +211,7 @@ void term_update(void) {
            seen_disp_event = seen_key_event = 0;
        }
        do_paint (ctx, TRUE);
+        sys_cursor(curs_x, curs_y + (scrtop - disptop) / (cols+1));
        free_ctx (ctx);
     }
 }
@@ -1221,20 +1222,15 @@ static int beep_overload = 0;
                compatibility(VT100);
                if (esc_nargs <= 2) {
                    int top, bot;
-                   /* VTTEST Bug 9 if the first arg is default _or_ zero
-                    * this is a full screen region irrespective of 2nd arg.
-                    */
-                   if (esc_args[0] <= 0) {
-                      top=0;
-                      bot=rows-1;
-                   } else {
-                      top = def(esc_args[0], 1) - 1;
-                      bot = (esc_nargs <= 1 || esc_args[1] == 0 ? rows :
-                             def(esc_args[1], rows)) - 1;
-                   }
+                   top = def(esc_args[0], 1) - 1;
+                   bot = (esc_nargs <= 1 || esc_args[1] == 0 ? rows :
+                          def(esc_args[1], rows)) - 1;
                    if (bot >= rows)
                        bot = rows-1;
-                   if (top <= bot) {
+                   /* VTTEST Bug 9 - if region is less than 2 lines
+                    * don't change region.
+                    */
+                   if (bot-top > 1) {
                        marg_t = top;
                        marg_b = bot;
                        curs_x = 0;
@@ -1700,7 +1696,7 @@ static int linecmp (unsigned long *a, unsigned long *b) {
  * Given a context, update the window. Out of paranoia, we don't
  * allow WM_PAINT responses to do scrolling optimisations.
  */
-static void do_paint (Context ctx, int may_optimise){ 
+static void do_paint (Context ctx, int may_optimise){
     int i, j, start, our_curs_y;
     unsigned long attr, rv, cursor;
     char ch[1024];