diff --git a/data/common/fb2read b/data/common/fb2read index bef55b1d95..7fd43f4c6f 100644 Binary files a/data/common/fb2read and b/data/common/fb2read differ diff --git a/programs/develop/cedit/CEDIT b/programs/develop/cedit/CEDIT index 88a311c85b..437fb2bd48 100644 Binary files a/programs/develop/cedit/CEDIT and b/programs/develop/cedit/CEDIT differ diff --git a/programs/develop/cedit/SRC/CEdit.ob07 b/programs/develop/cedit/SRC/CEdit.ob07 index 6f65c712b0..9f2c54a59e 100644 --- a/programs/develop/cedit/SRC/CEdit.ob07 +++ b/programs/develop/cedit/SRC/CEdit.ob07 @@ -28,7 +28,7 @@ IMPORT RW, Ini, EB := EditBox, Tabs, Toolbar, SB := StatusBar; CONST - HEADER = "CEdit (05-jan-2022)"; + HEADER = "CEdit (08-jan-2022)"; ShellFilter = ""; EditFilter = "SH|INC|TXT|ASM|OB07|C|CPP|H|PAS|PP|LUA|INI|JSON"; @@ -404,6 +404,8 @@ BEGIN CheckBox.paint(WH); END; + G.SetColor(canvas, K.borderColor); + G.VLine(canvas, 0, 0, canvas.height - 1); G.DrawCanvas(canvas, LEFT, TOP); NotFound; Replaced; @@ -1952,7 +1954,7 @@ VAR fileName, filePath: RW.tFileName; width, height, cliWidth, cliHeight: INTEGER; resized: BOOLEAN; - firstClickX, firstClickY, time: INTEGER; + firstClickX, firstClickY, time, blink: INTEGER; BEGIN header := ""; K.GetSystemColors; @@ -2066,11 +2068,17 @@ BEGIN K.SetEventsMask({0, 1, 2, 5, 6, 31}); Menu.init(resetTimer); draw_window; + blink := Ini.blink; + IF blink <= 0 THEN + blink := 0 + ELSIF blink < 30 THEN + blink := 30 + END; timerEnabled := TRUE; CursorTime := K.GetTickCount(); WHILE TRUE DO CurrentTime := K.GetTickCount(); - IF (CurrentTime - CursorTime > Ini.blink) & timerEnabled THEN + IF (CurrentTime - CursorTime > blink) & (blink > 0) & timerEnabled THEN CursorTime := CurrentTime; T.toggleCursor; repaint diff --git a/programs/develop/cedit/SRC/Clipboard.ob07 b/programs/develop/cedit/SRC/Clipboard.ob07 index fa9e5d4788..1ede44b8a4 100644 --- a/programs/develop/cedit/SRC/Clipboard.ob07 +++ b/programs/develop/cedit/SRC/Clipboard.ob07 @@ -49,7 +49,7 @@ VAR ptr, pchar: INTEGER; wch: WCHAR; BEGIN - cnt := bufSize(buffer) DIV 2; + cnt := bufSize(buffer) DIV SYSTEM.SIZE(WCHAR); size := cnt + 12; a := KOSAPI.malloc(size); ASSERT(a # 0); diff --git a/programs/develop/cedit/SRC/Ini.ob07 b/programs/develop/cedit/SRC/Ini.ob07 index e326d1b7fe..f6501497ad 100644 --- a/programs/develop/cedit/SRC/Ini.ob07 +++ b/programs/develop/cedit/SRC/Ini.ob07 @@ -151,11 +151,6 @@ PROCEDURE getSettings* (VAR build, run, debug: RW.tFileName); BEGIN Lines.setTabs(get_int(IniFileName, "settings", "tab", 4)); blink := get_int(IniFileName, "settings", "blink", 70); - IF blink = 0 THEN - blink := -1 - ELSE - blink := MIN(MAX(blink, 1), 1000) - END; getStr("settings", "build", build); getStr("settings", "run", run); getStr("settings", "debug", debug) diff --git a/programs/develop/cedit/SRC/Lines.ob07 b/programs/develop/cedit/SRC/Lines.ob07 index 6755d4ad14..eeef5e62b8 100644 --- a/programs/develop/cedit/SRC/Lines.ob07 +++ b/programs/develop/cedit/SRC/Lines.ob07 @@ -497,7 +497,10 @@ BEGIN _tab := 4 END; tabs := _tab > 0; - tab := ABS(_tab) + tab := ABS(_tab); + IF tab > 32 THEN + tab := 32 + END END setTabs; diff --git a/programs/develop/cedit/SRC/Text.ob07 b/programs/develop/cedit/SRC/Text.ob07 index 8f26d0ef4a..2099372594 100644 --- a/programs/develop/cedit/SRC/Text.ob07 +++ b/programs/develop/cedit/SRC/Text.ob07 @@ -26,7 +26,6 @@ IMPORT RW, Search, E := Encodings, CB := Clipboard, - K := KolibriOS, ChangeLog, File, Lang := Languages; @@ -75,7 +74,6 @@ TYPE enc, eol: INTEGER; table: Search.IdxTable; foundList: List.tList; - idxData: Search.tBuffer; foundSel: INTEGER; searchText: tString; chLog*: ChangeLog.tLog; @@ -818,7 +816,7 @@ BEGIN END leadingSpaces; -PROCEDURE plain (text: tText; eot: BOOLEAN): CB.tBuffer; +PROCEDURE plain (text: tText): CB.tBuffer; VAR buf: CB.tBuffer; size: INTEGER; @@ -834,10 +832,7 @@ BEGIN INC(size, CB.lenEOL) END END; - IF eot THEN - INC(size, 2) - END; - buf := CB.create(size); + buf := CB.create(size + 2); line := text.first(tLine); WHILE line # NIL DO CB.append(buf, line, 0, line.length - 1); @@ -846,43 +841,42 @@ BEGIN CB.eol(buf) END END; - IF eot THEN - CB.appends(buf, 0X + 0X, 0, 1) - END + CB.appends(buf, 0X, 0, 0); + CB.appends(buf, 0X, 0, 0) RETURN buf END plain; PROCEDURE search* (text: tText; s: ARRAY OF WCHAR; cs, whole: BOOLEAN): BOOLEAN; VAR - pos: List.tItem; - res: BOOLEAN; - plainText: Search.tBuffer; + pos: List.tItem; + res: BOOLEAN; + plainText, idxData: Search.tBuffer; BEGIN - plainText := NIL; - WHILE text.foundList.count # 0 DO - pos := List.pop(text.foundList); - DISPOSE(pos) - END; - text.whole := whole; - text.cs := cs; - text.searchText := s; - IF ~cs THEN - U.upcase16(text.searchText) - END; - IF text.searchText # "" THEN - plainText := plain(text, TRUE); - text.idxData := Search.index(plainText, text.table, cs); - Search.find(plainText, text.table, text.searchText, whole, text.foundList); - res := text.foundList.count > 0 - ELSE - res := TRUE - END; - CB.destroy(plainText); - CB.destroy(text.idxData); - text.search := FALSE; - text.foundSel := 0 - RETURN res + res := TRUE; + plainText := NIL; + idxData := NIL; + WHILE text.foundList.count # 0 DO + pos := List.pop(text.foundList); + DISPOSE(pos) + END; + text.whole := whole; + text.cs := cs; + text.searchText := s; + IF ~cs THEN + U.upcase16(text.searchText) + END; + IF text.searchText # "" THEN + plainText := plain(text); + idxData := Search.index(plainText, text.table, cs); + Search.find(plainText, text.table, text.searchText, whole, text.foundList); + res := text.foundList.count > 0 + END; + CB.destroy(plainText); + CB.destroy(idxData); + text.search := FALSE; + text.foundSel := 0 + RETURN res END search; @@ -1537,7 +1531,7 @@ BEGIN DEC(n) END; - buffer := CB.create(cnt); + buffer := CB.create(cnt + 2); (* +2 wchars EOT *) n := selEnd.Y - selBeg.Y; line := first; @@ -2343,9 +2337,7 @@ BEGIN IF drawCursor THEN cursor(text) - END; - G.SetColor(canvas, K.borderColor); - G.VLine(canvas, 0, 0, size.Y - 1); + END END draw; @@ -2380,7 +2372,6 @@ BEGIN text.whole := FALSE; text.numbers := TRUE; text.guard := TRUE; - text.idxData := NIL; text.edition := NIL; text.foundList := List.create(NIL); text.searchText := "";