Subversion Repositories SvarDOS

Rev

Rev 1390 | Rev 1393 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1390 Rev 1392
Line 291... Line 291...
291
static void ui_refresh(const struct file *db) {
291
static void ui_refresh(const struct file *db) {
292
  unsigned char x;
292
  unsigned char x;
293
  const struct line far *l;
293
  const struct line far *l;
294
  unsigned char y = db->cursorposy;
294
  unsigned char y = db->cursorposy;
295
 
295
 
-
 
296
  /* quit early if nothing to refresh */
-
 
297
  if (uidirty.from == 0xff) return;
-
 
298
 
296
#ifdef DBG_REFRESH
299
#ifdef DBG_REFRESH
297
  static char m = 'a';
300
  static char m = 'a';
298
  m++;
301
  m++;
299
  if (m > 'z') m = 'a';
302
  if (m > 'z') m = 'a';
300
#endif
303
#endif
Line 353... Line 356...
353
      col = topline * (screenh - 1) / totlines;
356
      col = topline * (screenh - 1) / totlines;
354
    }
357
    }
355
    if (col >= screenh - 1) col = screenh - 2;
358
    if (col >= screenh - 1) col = screenh - 2;
356
    mdr_cout_char(col, screenw - 1, ' ', SCHEME_SCROLL);
359
    mdr_cout_char(col, screenw - 1, ' ', SCHEME_SCROLL);
357
  }
360
  }
-
 
361
 
-
 
362
  /* clear out the dirty flag */
-
 
363
  uidirty.from = 0xff;
358
}
364
}
359
 
365
 
360
 
366
 
361
static void check_cursor_not_after_eol(struct file *db) {
367
static void check_cursor_not_after_eol(struct file *db) {
362
  if (db->xoffset + db->cursorposx <= db->cursor->len) return;
368
  if (db->xoffset + db->cursorposx <= db->cursor->len) return;
Line 885... Line 891...
885
    SCHEME_MENU = 0x70;
891
    SCHEME_MENU = 0x70;
886
    SCHEME_MENU_CUR = 0x6f;
892
    SCHEME_MENU_CUR = 0x6f;
887
    SCHEME_MENU_SEL = 0x66;
893
    SCHEME_MENU_SEL = 0x66;
888
    SCHEME_STBAR1 = 0x70;
894
    SCHEME_STBAR1 = 0x70;
889
    SCHEME_STBAR2 = 0x78;
895
    SCHEME_STBAR2 = 0x78;
890
    SCHEME_STBAR3 = 0x70;
896
    SCHEME_STBAR3 = 0x3f;
891
    SCHEME_SCROLL = 0x70;
897
    SCHEME_SCROLL = 0x70;
892
    SCHEME_MSG = 0x6f;
898
    SCHEME_MSG = 0x6f;
893
    SCHEME_ERR = 0x4f;
899
    SCHEME_ERR = 0x4f;
894
  }
900
  }
895
 
901
 
Line 904... Line 910...
904
    }
910
    }
905
 
911
 
906
    check_cursor_not_after_eol(db);
912
    check_cursor_not_after_eol(db);
907
    mdr_cout_locate(db->cursorposy, db->cursorposx);
913
    mdr_cout_locate(db->cursorposy, db->cursorposx);
908
 
914
 
909
    if (uidirty.from != 0xff) {
-
 
910
      ui_refresh(db);
915
    ui_refresh(db);
911
      uidirty.from = 0xff;
-
 
912
    }
916
 
913
    if ((uidirty.statusbar != 0) || (db->modflagprev != db->modflag)) {
917
    if ((uidirty.statusbar != 0) || (db->modflagprev != db->modflag)) {
914
      ui_basic(db, curfile);
918
      ui_basic(db, curfile);
915
      uidirty.statusbar = 0;
919
      uidirty.statusbar = 0;
916
      db->modflagprev = db->modflag;
920
      db->modflagprev = db->modflag;
917
    }
921
    }
Line 989... Line 993...
989
 
993
 
990
    } else if (k == 0x1B) { /* ESC */
994
    } else if (k == 0x1B) { /* ESC */
991
      int quitnow = 0;
995
      int quitnow = 0;
992
      char fname[25];
996
      char fname[25];
993
      int saveflag = 0;
997
      int saveflag = 0;
-
 
998
      unsigned short ui_action;
-
 
999
 
-
 
1000
      /* collect the exact menu action and clear the screen */
-
 
1001
      ui_action = ui_menu();
-
 
1002
      ui_refresh(db);
994
 
1003
 
995
      switch (ui_menu()) {
1004
      switch (ui_action) {
996
 
1005
 
997
        case MENU_NONE:
1006
        case MENU_NONE:
998
          break;
1007
          break;
999
 
1008
 
1000
        case MENU_OPEN:
1009
        case MENU_OPEN: