diff --git a/all.h b/all.h index ce29b53..31d9add 100644 --- a/all.h +++ b/all.h @@ -686,6 +686,7 @@ fn u32 stringLineStartByteOffset(String s, u32 line_number); fn bool stringInsertBytesAt(String* s, str bytes, u32 at); fn bool stringInsertBytesAtMaybeAlloc(Arena* a, String* s, str bytes, u32 at); fn u32 stringFindNextCharPosFrom(String s, u32 from, u8 c); +fn bool textPosEq(TextPos a, TextPos b); ///// OS-wrapped apis void osInit(); diff --git a/string.c b/string.c index 4d801a7..373eb23 100644 --- a/string.c +++ b/string.c @@ -505,3 +505,8 @@ fn u32 stringFindNextCharPosFrom(String s, u32 from, u8 c) { } return s.length; } + +fn bool textPosEq(TextPos a, TextPos b) { + return a.line == b.line && a.column == b.column; +} +