Subversion Repositories SvarDOS

Rev

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

Rev 1317 Rev 1318
Line 170... Line 170...
170
#undef MAXLINLEN
170
#undef MAXLINLEN
171
}
171
}
172
 
172
 
173
 
173
 
174
static void ui_refresh(const struct file *db, unsigned char screenw, unsigned char screenh, unsigned char uidirtyfrom, unsigned char uidirtyto) {
174
static void ui_refresh(const struct file *db, unsigned char screenw, unsigned char screenh, unsigned char uidirtyfrom, unsigned char uidirtyto) {
175
  unsigned char len;
175
  unsigned char x;
176
  const struct line far *l;
176
  const struct line far *l;
177
  unsigned char y = db->cursorposy;
177
  unsigned char y = db->cursorposy;
178
 
178
 
179
#ifdef DBG_REFRESH
179
#ifdef DBG_REFRESH
180
  static char m = 'a';
180
  static char m = 'a';
Line 190... Line 190...
190
 
190
 
191
    /* skip lines that do not need to be refreshed */
191
    /* skip lines that do not need to be refreshed */
192
    if (y < uidirtyfrom) continue;
192
    if (y < uidirtyfrom) continue;
193
    if (y > uidirtyto) break;
193
    if (y > uidirtyto) break;
194
 
194
 
-
 
195
    x = 0;
195
    if (db->xoffset < l->len) {
196
    if (db->xoffset < l->len) {
-
 
197
      unsigned char i, limit;
196
      for (len = 0; l->payload[len] != 0; len++) mdr_cout_char(y, len, l->payload[len], scheme[COL_TXT]);
198
      if (l->len - db->xoffset < screenw) {
-
 
199
        limit = l->len;
197
    } else {
200
      } else {
-
 
201
        limit = db->xoffset + screenw - 1;
198
      len = 0;
202
      }
-
 
203
      for (i = db->xoffset; i < limit; i++) mdr_cout_char(y, x++, l->payload[i], scheme[COL_TXT]);
199
    }
204
    }
-
 
205
 
-
 
206
    /* write empty spaces until end of line */
200
    while (len < screenw - 1) mdr_cout_char(y, len++, ' ', scheme[COL_TXT]);
207
    if (x < screenw - 1) mdr_cout_char_rep(y, x, ' ', scheme[COL_TXT], screenw - 1 - x);
201
 
208
 
202
#ifdef DBG_REFRESH
209
#ifdef DBG_REFRESH
203
    mdr_cout_char(y, 0, m, scheme[COL_STATUSBAR1]);
210
    mdr_cout_char(y, 0, m, scheme[COL_STATUSBAR1]);
204
#endif
211
#endif
205
 
212
 
206
    if (y == screenh - 2) break;
213
    if (y == screenh - 2) break;
207
  }
214
  }
208
 
215
 
-
 
216
  while (y < screenh - 1) {
-
 
217
    mdr_cout_char_rep(y++, 0, ' ', scheme[COL_TXT], screenw - 1);
-
 
218
  }
209
}
219
}
210
 
220
 
211
 
221
 
212
static void check_cursor_not_after_eol(struct file *db, unsigned char *uidirtyfrom, unsigned char *uidirtyto) {
222
static void check_cursor_not_after_eol(struct file *db, unsigned char *uidirtyfrom, unsigned char *uidirtyto) {
213
  if (db->xoffset + db->cursorposx <= db->cursor->len) return;
223
  if (db->xoffset + db->cursorposx <= db->cursor->len) return;