Text editor: prototype based setup

This commit is contained in:
Krzosa Karol
2024-06-08 15:26:38 +02:00
parent 27b197840b
commit 2ec4a2a28d
5 changed files with 575 additions and 486 deletions

View File

@@ -27,25 +27,6 @@ GetRangeSize :: proc(range: Range): int {
return result;
}
ClampInt :: proc(val: int, min: int, max: int): int {
result := val;
if (val < min) result = min;
if (val > max) result = max;
return result;
}
MinInt :: proc(a: int, b: int): int {
result := a;
if (a > b) result = b;
return result;
}
MaxInt :: proc(a: int, b: int): int {
result := b;
if (a > b) result = a;
return result;
}
AdjustUTF8PosUnsafe :: proc(buffer: *Buffer, pos: int, direction: int = 1): int {
for pos >= 0 && pos < buffer.len && IsUTF8ContinuationByte(buffer.data[pos]) {
pos += direction;