From b4e4d170c2ba31287ddbce3cff567a4ae10b6492 Mon Sep 17 00:00:00 2001 From: Roderic Bos Date: Wed, 4 Jan 2023 15:23:16 +0100 Subject: [PATCH 01/19] Make it build on windows --- build_msvc.bat | 7 ++++--- setup_dependencies.bat | 2 ++ src/file.c | 2 ++ src/sdl_extra.c | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/build_msvc.bat b/build_msvc.bat index f4c3009..10fb7e4 100644 --- a/build_msvc.bat +++ b/build_msvc.bat @@ -1,12 +1,13 @@ @echo off rem launch this from msvc-enabled console -set CFLAGS=/W4 /WX /std:c11 /wd4996 /wd5105 /FC /TC /Zi /nologo -set INCLUDES=/I dependencies\SDL2\include /I dependencies\GLFW\include /I dependencies\GLEW\include +set CFLAGS=/W4 /WX /std:c11 /wd4996 /wd5105 /wd4459 /wd4267 /wd4244 /FC /TC /Zi /nologo +set INCLUDES=/I dependencies\SDL2\include /I dependencies\GLFW\include /I dependencies\GLEW\include /I dependencies\freetype2\include set LIBS=dependencies\SDL2\lib\x64\SDL2.lib ^ dependencies\SDL2\lib\x64\SDL2main.lib ^ dependencies\GLFW\lib\glfw3.lib ^ dependencies\GLEW\lib\glew32s.lib ^ + "dependencies\freetype2\release dll\win64\freetype.lib" ^ opengl32.lib User32.lib Gdi32.lib Shell32.lib -cl.exe %CFLAGS% %INCLUDES% /Feded src\main.c src\la.c src\editor.c src\sdl_extra.c src\file.c src\gl_extra.c /link %LIBS% -SUBSYSTEM:windows +cl.exe %CFLAGS% %INCLUDES% /Feded src\main.c src\la.c src\editor.c src\sdl_extra.c src\file.c src\gl_extra.c src\free_glyph.c src\simple_renderer.c src/uniforms.c /link %LIBS% -SUBSYSTEM:console diff --git a/setup_dependencies.bat b/setup_dependencies.bat index 9fbc6b8..540cc88 100644 --- a/setup_dependencies.bat +++ b/setup_dependencies.bat @@ -26,3 +26,5 @@ if not exist dependencies\GLEW\include\GL\ mkdir dependencies\GLEW\include\GL\ move glew-2.1.0\include\GL\glew.h dependencies\GLEW\include\GL\glew.h del glew-2.1.0-win32.zip rmdir /s /q glew-2.1.0 + +git clone https://github.com/ubawurinna/freetype-windows-binaries.git dependencies/freetype2 \ No newline at end of file diff --git a/src/file.c b/src/file.c index 5157022..d5266d9 100644 --- a/src/file.c +++ b/src/file.c @@ -22,6 +22,8 @@ char *slurp_file(const char *file_path) char *buffer = malloc(size + 1); if (buffer == NULL) SLURP_FILE_PANIC; + memset(buffer,0,_msize(buffer)); + if (fseek(f, 0, SEEK_SET) < 0) SLURP_FILE_PANIC; fread(buffer, 1, size, f); diff --git a/src/sdl_extra.c b/src/sdl_extra.c index f12bb12..58cccbd 100644 --- a/src/sdl_extra.c +++ b/src/sdl_extra.c @@ -1,4 +1,5 @@ #include "./sdl_extra.h" +#include void scc(int code) { From 591c05e05f61a739ab07ae741f5962a845fbe40c Mon Sep 17 00:00:00 2001 From: Roderic Bos Date: Wed, 4 Jan 2023 15:25:12 +0100 Subject: [PATCH 02/19] ignore all dependencies --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 62061e7..9ce7599 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ te ded SDL2 +dependencies/* *.exe *.obj *.pdb From 1d0ddea9885f33e22cfb05b49dffdb738596330c Mon Sep 17 00:00:00 2001 From: Roderic Bos Date: Thu, 12 Jan 2023 09:58:46 +0100 Subject: [PATCH 03/19] fix build errors after merge --- build_msvc.bat | 4 ++-- src/common.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/build_msvc.bat b/build_msvc.bat index a30918b..f912b96 100644 --- a/build_msvc.bat +++ b/build_msvc.bat @@ -1,7 +1,7 @@ @echo off rem launch this from msvc-enabled console -set CFLAGS=/W4 /WX /std:c11 /wd4996 /wd5105 /wd4459 /wd4267 /wd4244 /FC /TC /Zi /nologo +set CFLAGS=/W4 /WX /std:c11 /wd4996 /wd5105 /wd4459 /wd4267 /wd4244 /wd4200 /FC /TC /Zi /nologo set INCLUDES=/I dependencies\SDL2\include /I dependencies\GLFW\include /I dependencies\GLEW\include /I dependencies\freetype2\include set LIBS=dependencies\SDL2\lib\x64\SDL2.lib ^ dependencies\SDL2\lib\x64\SDL2main.lib ^ @@ -10,4 +10,4 @@ set LIBS=dependencies\SDL2\lib\x64\SDL2.lib ^ "dependencies\freetype2\release dll\win64\freetype.lib" ^ opengl32.lib User32.lib Gdi32.lib Shell32.lib -cl.exe %CFLAGS% %INCLUDES% /Feded src\main.c src\la.c src\editor.c src\file_browser.c src\free_glyph.c src\simple_renderer.c src\common.c src\free_glyph.c src\simple_renderer.c src/uniforms.c /link %LIBS% -SUBSYSTEM:console +cl.exe %CFLAGS% %INCLUDES% /Feded src\main.c src\la.c src\editor.c src\file_browser.c src\free_glyph.c src\simple_renderer.c src\common.c src\free_glyph.c src\simple_renderer.c /link %LIBS% -SUBSYSTEM:console diff --git a/src/common.c b/src/common.c index 1d3f240..899fd5d 100644 --- a/src/common.c +++ b/src/common.c @@ -5,7 +5,8 @@ #ifdef _WIN32 # define MINIRENT_IMPLEMENTATION -# include +# include +# include "minirent.h" #else # include #endif // _WIN32 @@ -101,6 +102,7 @@ Errno read_entire_file(const char *file_path, String_Builder *sb) sb->items = realloc(sb->items, sb->capacity*sizeof(*sb->items)); assert(sb->items != NULL && "Buy more RAM lol"); } + memset(sb->items,0,_msize(sb->items)); fread(sb->items, size, 1, f); if (ferror(f)) return_defer(errno); From 56061516e11e64e4e971b51d6bdc8f2bd018fc36 Mon Sep 17 00:00:00 2001 From: Roderic Bos Date: Thu, 12 Jan 2023 12:54:00 +0100 Subject: [PATCH 04/19] try to enable windows --- .github/workflows/ci.yml | 50 ++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db6642a..3ab2efd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: env: CC: clang build-macos: - runs-on: macOS-latest + runs-on: macos-latest steps: - uses: actions/checkout@v1 - name: install dependencies @@ -44,27 +44,27 @@ jobs: CC: clang # TODO(#29): build-windows-msvc is broken # --- - # build-windows-msvc: - # runs-on: windows-2019 - # steps: - # - uses: actions/checkout@v1 - # # this runs vcvarsall for us, so we get the MSVC toolchain in PATH. - # - uses: seanmiddleditch/gha-setup-vsdevenv@master - # - name: Install dependencies - # run: | - # ./setup_dependencies.bat - # - name: build ded - # shell: cmd - # run: | - # ./build_msvc.bat - # - name: Prepare WindowsBinaries artifacts - # shell: cmd - # run: | - # mkdir winbin - # copy /B *.exe winbin - # copy /B *.png winbin - # - name: Upload WindowsBinaries artifacts - # uses: actions/upload-artifact@v2 - # with: - # name: WindowsBinaries - # path: ./winbin/ + build-windows-msvc: + runs-on: windows-2019 + steps: + - uses: actions/checkout@v1 + # this runs vcvarsall for us, so we get the MSVC toolchain in PATH. + - uses: seanmiddleditch/gha-setup-vsdevenv@master + - name: Install dependencies + run: | + ./setup_dependencies.bat + - name: build ded + shell: cmd + run: | + ./build_msvc.bat + - name: Prepare WindowsBinaries artifacts + shell: cmd + run: | + mkdir winbin + copy /B *.exe winbin + copy /B *.png winbin + - name: Upload WindowsBinaries artifacts + uses: actions/upload-artifact@v2 + with: + name: WindowsBinaries + path: ./winbin/ From f49f8ee5b905b68f820c7472af9844c7a12bd8c6 Mon Sep 17 00:00:00 2001 From: Roderic Bos Date: Thu, 12 Jan 2023 12:55:51 +0100 Subject: [PATCH 05/19] remove todo --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ab2efd..e99d16b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,8 +42,6 @@ jobs: ./build.sh env: CC: clang - # TODO(#29): build-windows-msvc is broken - # --- build-windows-msvc: runs-on: windows-2019 steps: From 1ab0383a3f63ad3bdbf3da200d23ab390b26fa8e Mon Sep 17 00:00:00 2001 From: Roderic Bos Date: Thu, 12 Jan 2023 13:02:26 +0100 Subject: [PATCH 06/19] fix build errors --- src/common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common.c b/src/common.c index 899fd5d..18e95b4 100644 --- a/src/common.c +++ b/src/common.c @@ -44,7 +44,7 @@ Errno read_entire_dir(const char *dir_path, Files *files) errno = 0; struct dirent *ent = readdir(dir); while (ent != NULL) { - da_append(files, temp_strdup(ent->d_name)); + da_append(files, temp_strdup((const char*)ent->d_name)); ent = readdir(dir); } @@ -102,8 +102,9 @@ Errno read_entire_file(const char *file_path, String_Builder *sb) sb->items = realloc(sb->items, sb->capacity*sizeof(*sb->items)); assert(sb->items != NULL && "Buy more RAM lol"); } +#ifdef _WIN32 memset(sb->items,0,_msize(sb->items)); - +#endif // _WIN32 fread(sb->items, size, 1, f); if (ferror(f)) return_defer(errno); sb->count = size; From 7e32a9bfbbed5d744cbf8380a7f5ee466919f7d1 Mon Sep 17 00:00:00 2001 From: Roderic Bos Date: Thu, 12 Jan 2023 13:10:44 +0100 Subject: [PATCH 07/19] fix warning --- src/file_browser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/file_browser.c b/src/file_browser.c index 2bfcc75..1ad37c8 100644 --- a/src/file_browser.c +++ b/src/file_browser.c @@ -16,6 +16,6 @@ Errno fb_open_dir(File_Browser *fb, const char *dir_path) if (err != 0) { return err; } - qsort(fb->files.items, fb->files.count, sizeof(*fb->files.items), file_cmp); + qsort((void* )fb->files.items, fb->files.count, sizeof(*fb->files.items), file_cmp); return 0; } From 4ff2e6f89ffe49caac84ca8a16860c1c3ff1a0f6 Mon Sep 17 00:00:00 2001 From: Roderic Bos Date: Thu, 12 Jan 2023 13:15:58 +0100 Subject: [PATCH 08/19] just disable warning sigh --- build_msvc.bat | 2 +- src/common.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build_msvc.bat b/build_msvc.bat index f912b96..53f1c30 100644 --- a/build_msvc.bat +++ b/build_msvc.bat @@ -1,7 +1,7 @@ @echo off rem launch this from msvc-enabled console -set CFLAGS=/W4 /WX /std:c11 /wd4996 /wd5105 /wd4459 /wd4267 /wd4244 /wd4200 /FC /TC /Zi /nologo +set CFLAGS=/W4 /WX /std:c11 /wd4996 /wd5105 /wd4459 /wd4267 /wd4244 /wd4200 /wd4090 /FC /TC /Zi /nologo set INCLUDES=/I dependencies\SDL2\include /I dependencies\GLFW\include /I dependencies\GLEW\include /I dependencies\freetype2\include set LIBS=dependencies\SDL2\lib\x64\SDL2.lib ^ dependencies\SDL2\lib\x64\SDL2main.lib ^ diff --git a/src/common.c b/src/common.c index 18e95b4..943ce1c 100644 --- a/src/common.c +++ b/src/common.c @@ -44,7 +44,7 @@ Errno read_entire_dir(const char *dir_path, Files *files) errno = 0; struct dirent *ent = readdir(dir); while (ent != NULL) { - da_append(files, temp_strdup((const char*)ent->d_name)); + da_append(files, temp_strdup(ent->d_name)); ent = readdir(dir); } From 907aa75e498ff9a37c437b8c89aaf41ede996fab Mon Sep 17 00:00:00 2001 From: Roderic Bos Date: Thu, 12 Jan 2023 13:29:06 +0100 Subject: [PATCH 09/19] only ded.* as binaries --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e99d16b..16c31c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,8 +59,7 @@ jobs: shell: cmd run: | mkdir winbin - copy /B *.exe winbin - copy /B *.png winbin + copy /B ded.* winbin - name: Upload WindowsBinaries artifacts uses: actions/upload-artifact@v2 with: From 8e7ca5b5a81e9d675c1ec9c4efa7cd0cc3e850b6 Mon Sep 17 00:00:00 2001 From: Roderic Bos Date: Thu, 12 Jan 2023 13:31:52 +0100 Subject: [PATCH 10/19] revert change warning is disabled --- src/file_browser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/file_browser.c b/src/file_browser.c index 1ad37c8..2bfcc75 100644 --- a/src/file_browser.c +++ b/src/file_browser.c @@ -16,6 +16,6 @@ Errno fb_open_dir(File_Browser *fb, const char *dir_path) if (err != 0) { return err; } - qsort((void* )fb->files.items, fb->files.count, sizeof(*fb->files.items), file_cmp); + qsort(fb->files.items, fb->files.count, sizeof(*fb->files.items), file_cmp); return 0; } From fec693d71df44781a47168d65c80ec576cb505ef Mon Sep 17 00:00:00 2001 From: Roderic Bos Date: Thu, 12 Jan 2023 13:54:27 +0100 Subject: [PATCH 11/19] add required binaries --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16c31c3..9555709 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,6 +60,8 @@ jobs: run: | mkdir winbin copy /B ded.* winbin + copy /B dependencies\SDL2\lib\x64\SDL2.dll winbin + copy /B "dependencies\freetype2\release dll\win64\freetype.dll" winbin - name: Upload WindowsBinaries artifacts uses: actions/upload-artifact@v2 with: From 41d12579991032fcd8b2866fa9ac239337d13d1e Mon Sep 17 00:00:00 2001 From: Roderic Bos Date: Thu, 12 Jan 2023 16:37:14 +0100 Subject: [PATCH 12/19] doh! we have capacity.... --- src/common.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/common.c b/src/common.c index 943ce1c..44792c4 100644 --- a/src/common.c +++ b/src/common.c @@ -102,9 +102,7 @@ Errno read_entire_file(const char *file_path, String_Builder *sb) sb->items = realloc(sb->items, sb->capacity*sizeof(*sb->items)); assert(sb->items != NULL && "Buy more RAM lol"); } -#ifdef _WIN32 - memset(sb->items,0,_msize(sb->items)); -#endif // _WIN32 + memset(sb->items,0,sb->capacity); fread(sb->items, size, 1, f); if (ferror(f)) return_defer(errno); sb->count = size; From a0c199739d8ca97d0fa387419640c9a6e775c8c4 Mon Sep 17 00:00:00 2001 From: Roderic Bos Date: Fri, 13 Jan 2023 14:52:06 +0100 Subject: [PATCH 13/19] upgrade runner to new version (old one is deprecated and didn't work anymore) --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9555709..be074fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,7 @@ on: jobs: build-linux-gcc: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 - name: install dependencies @@ -19,7 +19,7 @@ jobs: env: CC: gcc build-linux-clang: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 - name: install dependencies From 863c66888fc15f927bfb2da42419623a39a8cbf2 Mon Sep 17 00:00:00 2001 From: Roderic Bos Date: Tue, 17 Jan 2023 11:28:50 +0100 Subject: [PATCH 14/19] added lexer to build --- build_msvc.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_msvc.bat b/build_msvc.bat index 53f1c30..7d0d036 100644 --- a/build_msvc.bat +++ b/build_msvc.bat @@ -1,7 +1,7 @@ @echo off rem launch this from msvc-enabled console -set CFLAGS=/W4 /WX /std:c11 /wd4996 /wd5105 /wd4459 /wd4267 /wd4244 /wd4200 /wd4090 /FC /TC /Zi /nologo +set CFLAGS=/W4 /WX /std:c11 /wd4996 /wd5105 /wd4459 /wd4267 /wd4244 /wd4200 /wd4090 /wd4702 /FC /TC /Zi /nologo set INCLUDES=/I dependencies\SDL2\include /I dependencies\GLFW\include /I dependencies\GLEW\include /I dependencies\freetype2\include set LIBS=dependencies\SDL2\lib\x64\SDL2.lib ^ dependencies\SDL2\lib\x64\SDL2main.lib ^ @@ -10,4 +10,4 @@ set LIBS=dependencies\SDL2\lib\x64\SDL2.lib ^ "dependencies\freetype2\release dll\win64\freetype.lib" ^ opengl32.lib User32.lib Gdi32.lib Shell32.lib -cl.exe %CFLAGS% %INCLUDES% /Feded src\main.c src\la.c src\editor.c src\file_browser.c src\free_glyph.c src\simple_renderer.c src\common.c src\free_glyph.c src\simple_renderer.c /link %LIBS% -SUBSYSTEM:console +cl.exe %CFLAGS% %INCLUDES% /Feded src\main.c src\la.c src\editor.c src\file_browser.c src\free_glyph.c src\simple_renderer.c src\common.c src\free_glyph.c src\simple_renderer.c src\lexer.c /link %LIBS% -SUBSYSTEM:console From fbabd0d0d5e7ce39f05edd2ae73cd148c9a68ce8 Mon Sep 17 00:00:00 2001 From: Roderic Bos Date: Thu, 9 Feb 2023 20:06:13 +0100 Subject: [PATCH 15/19] added quick type_of_file implementation --- src/common.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common.c b/src/common.c index 479dfa6..6acb287 100644 --- a/src/common.c +++ b/src/common.c @@ -132,7 +132,14 @@ Vec4f hex_to_vec4f(uint32_t color) Errno type_of_file(const char *file_path, File_Type *ft) { #ifdef _WIN32 -#error "TODO: type_of_file() is not implemented for Windows" + wchar_t* wString[4096]; + MultiByteToWideChar(CP_ACP, 0, file_path, -1, (LPWSTR)wString, 4096); + DWORD attr = GetFileAttributesW((LPWSTR)wString); + if (attr & FILE_ATTRIBUTE_DIRECTORY) { + *ft = FT_DIRECTORY; + } else { + *ft = FT_REGULAR; + } #else struct stat sb = {0}; if (stat(file_path, &sb) < 0) return errno; From 3516c86945052626dc68e76ed0e3c719a5b351ef Mon Sep 17 00:00:00 2001 From: Roderic Bos Date: Sat, 18 Feb 2023 10:32:09 +0100 Subject: [PATCH 16/19] add isalnum definition... --- src/common.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common.h b/src/common.h index 761b093..131215f 100644 --- a/src/common.h +++ b/src/common.h @@ -6,6 +6,10 @@ #include #include "./la.h" +#ifdef _WIN32 + int isalnum(int c); +#endif // _WIN32 + #define SCREEN_WIDTH 800 #define SCREEN_HEIGHT 600 #define FPS 60 From 39a434f52f75542a28d164174fbed248e384f2d7 Mon Sep 17 00:00:00 2001 From: Roderic Bos Date: Sat, 18 Feb 2023 18:49:06 +0100 Subject: [PATCH 17/19] just use ctype --- src/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.h b/src/common.h index 131215f..f157d94 100644 --- a/src/common.h +++ b/src/common.h @@ -7,7 +7,7 @@ #include "./la.h" #ifdef _WIN32 - int isalnum(int c); +# include //currently for isalnum only #endif // _WIN32 #define SCREEN_WIDTH 800 From 0d399fc72f0598d628b95b7038d7c50b67558e33 Mon Sep 17 00:00:00 2001 From: Roderic Bos Date: Sun, 12 Mar 2023 12:16:04 +0100 Subject: [PATCH 18/19] float suffix --- src/editor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor.c b/src/editor.c index 1aaeee7..b11b0b9 100644 --- a/src/editor.c +++ b/src/editor.c @@ -323,7 +323,7 @@ void editor_render(SDL_Window *window, Free_Glyph_Atlas *atlas, Simple_Renderer { if (editor->searching) { simple_renderer_set_shader(sr, SHADER_FOR_COLOR); - Vec4f selection_color = vec4f(.10, .10, .25, 1); + Vec4f selection_color = vec4f(.10f, .10f, .25f, 1.0f); Vec2f p1 = cursor_pos; Vec2f p2 = p1; free_glyph_atlas_measure_line_sized(editor->atlas, editor->search.items, editor->search.count, &p2); From 63f3b4efda2949198e62ee103c8dab70fc5e5947 Mon Sep 17 00:00:00 2001 From: Roderic Bos Date: Sun, 12 Mar 2023 13:01:55 +0100 Subject: [PATCH 19/19] wierd number thing in c --- src/editor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor.c b/src/editor.c index b11b0b9..d7337d4 100644 --- a/src/editor.c +++ b/src/editor.c @@ -323,7 +323,7 @@ void editor_render(SDL_Window *window, Free_Glyph_Atlas *atlas, Simple_Renderer { if (editor->searching) { simple_renderer_set_shader(sr, SHADER_FOR_COLOR); - Vec4f selection_color = vec4f(.10f, .10f, .25f, 1.0f); + Vec4f selection_color = vec4f(.10f, .10f, .25, 1); Vec2f p1 = cursor_pos; Vec2f p2 = p1; free_glyph_atlas_measure_line_sized(editor->atlas, editor->search.items, editor->search.count, &p2);