CEDIT: minor fixes

git-svn-id: svn://kolibrios.org@9200 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Anton Krotov 2021-09-24 18:04:52 +00:00
parent a33723e2b3
commit 95dfb31882
4 changed files with 14 additions and 14 deletions

Binary file not shown.

View File

@ -28,7 +28,7 @@ IMPORT
RW, Ini, EB := EditBox, Icons, Tabs, Timer;
CONST
header = "CEdit (21-sep-2021)";
header = "CEdit (24-sep-2021)";
ShellFilter = "";
EditFilter = "SH|ASM|TXT|INC|OB07|C|CPP|H|PAS|PP|LUA|INI|JSON";

View File

@ -63,6 +63,7 @@ VAR
eol*: ARRAY 3 OF tEOL;
eolNames*: ARRAY 3, 16 OF WCHAR;
strBuf: ARRAY 1000000 OF WCHAR;
PROCEDURE getByte (file: tInput): BYTE;
@ -168,9 +169,8 @@ PROCEDURE getString* (file: tInput; line: Lines.tLine; tabs: BOOLEAN; VAR eol: B
VAR
c: WCHAR;
i, L, k, n: INTEGER;
s: ARRAY 1000 OF WCHAR;
BEGIN
L := LEN(s);
L := LEN(strBuf);
eol := FALSE;
n := 0;
i := ORD(file.cnt > 0) - 1;
@ -190,21 +190,21 @@ BEGIN
ELSIF c = TAB THEN
k := Lines.tab - i MOD Lines.tab;
IF tabs THEN
s[i] := TAB
strBuf[i] := TAB
ELSE
s[i] := SPACE
strBuf[i] := SPACE
END;
INC(i);
DEC(k);
WHILE k > 0 DO
IF tabs THEN
s[i] := Lines.TAB1
strBuf[i] := Lines.TAB1
ELSE
s[i] := SPACE
strBuf[i] := SPACE
END;
INC(i);
IF i = L THEN
Lines.concat(line, s);
Lines.concat(line, strBuf);
INC(n, i);
i := 0
END;
@ -214,10 +214,10 @@ BEGIN
ELSIF c = BOM THEN
file.CR := FALSE
ELSE
s[i] := c;
strBuf[i] := c;
INC(i);
IF i = L THEN
Lines.concat(line, s);
Lines.concat(line, strBuf);
INC(n, i);
i := 0
END;
@ -225,8 +225,8 @@ BEGIN
END
END;
IF i >= 0 THEN
s[i] := 0X;
Lines.concat(line, s);
strBuf[i] := 0X;
Lines.concat(line, strBuf);
END;
INC(n, i)
RETURN n

View File

@ -194,7 +194,7 @@ BEGIN
m := (maxPos + 1) MOD scroll.maxVal;
pos := value*n + MIN(value, m)
ELSE
pos := value*(maxPos + 1) DIV scroll.maxVal
pos := FLOOR(FLT(value)*FLT(maxPos + 1)/FLT(scroll.maxVal))
END;
IF pos > maxPos THEN
pos := maxPos;
@ -267,7 +267,7 @@ BEGIN
END
END
ELSE
value := scroll.maxVal*pos DIV (maxPos + 1)
value := FLOOR(FLT(scroll.maxVal)*FLT(pos)/FLT(maxPos + 1))
END
END
ELSE