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; RW, Ini, EB := EditBox, Icons, Tabs, Timer;
CONST CONST
header = "CEdit (21-sep-2021)"; header = "CEdit (24-sep-2021)";
ShellFilter = ""; ShellFilter = "";
EditFilter = "SH|ASM|TXT|INC|OB07|C|CPP|H|PAS|PP|LUA|INI|JSON"; 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; eol*: ARRAY 3 OF tEOL;
eolNames*: ARRAY 3, 16 OF WCHAR; eolNames*: ARRAY 3, 16 OF WCHAR;
strBuf: ARRAY 1000000 OF WCHAR;
PROCEDURE getByte (file: tInput): BYTE; PROCEDURE getByte (file: tInput): BYTE;
@ -168,9 +169,8 @@ PROCEDURE getString* (file: tInput; line: Lines.tLine; tabs: BOOLEAN; VAR eol: B
VAR VAR
c: WCHAR; c: WCHAR;
i, L, k, n: INTEGER; i, L, k, n: INTEGER;
s: ARRAY 1000 OF WCHAR;
BEGIN BEGIN
L := LEN(s); L := LEN(strBuf);
eol := FALSE; eol := FALSE;
n := 0; n := 0;
i := ORD(file.cnt > 0) - 1; i := ORD(file.cnt > 0) - 1;
@ -190,21 +190,21 @@ BEGIN
ELSIF c = TAB THEN ELSIF c = TAB THEN
k := Lines.tab - i MOD Lines.tab; k := Lines.tab - i MOD Lines.tab;
IF tabs THEN IF tabs THEN
s[i] := TAB strBuf[i] := TAB
ELSE ELSE
s[i] := SPACE strBuf[i] := SPACE
END; END;
INC(i); INC(i);
DEC(k); DEC(k);
WHILE k > 0 DO WHILE k > 0 DO
IF tabs THEN IF tabs THEN
s[i] := Lines.TAB1 strBuf[i] := Lines.TAB1
ELSE ELSE
s[i] := SPACE strBuf[i] := SPACE
END; END;
INC(i); INC(i);
IF i = L THEN IF i = L THEN
Lines.concat(line, s); Lines.concat(line, strBuf);
INC(n, i); INC(n, i);
i := 0 i := 0
END; END;
@ -214,10 +214,10 @@ BEGIN
ELSIF c = BOM THEN ELSIF c = BOM THEN
file.CR := FALSE file.CR := FALSE
ELSE ELSE
s[i] := c; strBuf[i] := c;
INC(i); INC(i);
IF i = L THEN IF i = L THEN
Lines.concat(line, s); Lines.concat(line, strBuf);
INC(n, i); INC(n, i);
i := 0 i := 0
END; END;
@ -225,8 +225,8 @@ BEGIN
END END
END; END;
IF i >= 0 THEN IF i >= 0 THEN
s[i] := 0X; strBuf[i] := 0X;
Lines.concat(line, s); Lines.concat(line, strBuf);
END; END;
INC(n, i) INC(n, i)
RETURN n RETURN n

View File

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