Subversion Repositories SvarDOS

Rev

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

Rev 1580 Rev 1759
Line 1... Line 1...
1
/* Sved, the SvarDOS editor
1
/* Sved, the SvarDOS editor
2
 *
2
 *
3
 * Copyright (C) 2023 Mateusz Viste
3
 * Copyright (C) 2023-2024 Mateusz Viste
4
 *
4
 *
5
 * Sved is released under the terms of the MIT license.
5
 * Sved is released under the terms of the MIT license.
6
 *
6
 *
7
 * Permission is hereby granted, free of charge, to any person obtaining a copy
7
 * Permission is hereby granted, free of charge, to any person obtaining a copy
8
 * of this software and associated documentation files (the "Software"), to
8
 * of this software and associated documentation files (the "Software"), to
Line 30... Line 30...
30
#include "mdr\dos.h"
30
#include "mdr\dos.h"
31
 
31
 
32
#include "svarlang\svarlang.h"
32
#include "svarlang\svarlang.h"
33
 
33
 
34
 
34
 
35
#define PVER "2023.5"
35
#define PVER "2024.0"
36
#define PDATE "2023"
36
#define PDATE "2023-2024"
37
 
37
 
38
/*****************************************************************************
38
/*****************************************************************************
39
 * global variables and definitions                                          *
39
 * global variables and definitions                                          *
40
 *****************************************************************************/
40
 *****************************************************************************/
41
 
41
 
Line 855... Line 855...
855
        goto IOERR;
855
        goto IOERR;
856
      }
856
      }
857
      eolfound = 0;
857
      eolfound = 0;
858
    }
858
    }
859
 
859
 
860
    /* append 8 spaces if tab char found */
860
    /* tab: append enough spaces to land on next 8-chars boundary */
861
    if ((consumedbytes < len) && (buffptr[consumedbytes] == '\t') && (glob_tablessmode == 0)) {
861
    if ((consumedbytes < len) && (buffptr[consumedbytes] == '\t') && (glob_tablessmode == 0)) {
862
      consumedbytes++;
862
      consumedbytes++;
863
      if (line_append(db, "        ", 8) != 0) {
863
      if (line_append(db, "        ", 8 - (db->cursor->len & 7)) != 0) {
864
        goto IOERR;
864
        goto IOERR;
865
      }
865
      }
866
    }
866
    }
867
 
867
 
868
    /* anything left? process the buffer leftover again */
868
    /* anything left? process the buffer leftover again */
Line 1366... Line 1366...
1366
 
1366
 
1367
    } else if ((k >= 0x20) && (k <= 0xff)) { /* "normal" character */
1367
    } else if ((k >= 0x20) && (k <= 0xff)) { /* "normal" character */
1368
      char c = k;
1368
      char c = k;
1369
      insert_in_line(db, &c, 1);
1369
      insert_in_line(db, &c, 1);
1370
 
1370
 
1371
    } else if (k == 0x009) { /* TAB */
1371
    } else if (k == 0x009) { /* TAB: fill blanks to next 8-chars boundary */
1372
      if (glob_tablessmode == 0) {
1372
      if (glob_tablessmode == 0) {
1373
        insert_in_line(db, "        ", 8);
1373
        insert_in_line(db, "        ", 8 - ((db->xoffset + db->cursorposx) & 7));
1374
      } else {
1374
      } else {
1375
        insert_in_line(db, "\t", 1);
1375
        insert_in_line(db, "\t", 1);
1376
      }
1376
      }
1377
 
1377
 
1378
    } else if ((k >= 0x13b) && (k <= 0x144)) { /* F1..F10 */
1378
    } else if ((k >= 0x13b) && (k <= 0x144)) { /* F1..F10 */